Disable XInput handling for keyboard events, re-enabling key press and

release events when pointer is outside window as well as re-enabling
keyrepeat.
* clutter/glx/clutter-stage-glx.c: (clutter_stage_glx_realize): select
for KeyPressMask and KeyReleaseMask even with XInput enabled.
* clutter/x11/clutter-backend-x11.c: (_clutter_x11_register_xinput): 
Disabled the XInput keyboard code paths (comments and #if 0's)
* clutter/x11/clutter-event-x11.c: (event_translate): always handle
keyboard events without regard to XInput.
This commit is contained in:
Øyvind Kolås 2008-06-30 14:01:03 +00:00
parent 9fa47035ac
commit 5525d0cad7
4 changed files with 44 additions and 16 deletions

View File

@ -1,8 +1,21 @@
2008-06-30 Øyvind Kolås <pippin@o-hand.com>
Disable XInput handling for keyboard events, re-enabling key press and
release events when pointer is outside window as well as re-enabling
keyrepeat.
* clutter/glx/clutter-stage-glx.c: (clutter_stage_glx_realize): select
for KeyPressMask and KeyReleaseMask even with XInput enabled.
* clutter/x11/clutter-backend-x11.c: (_clutter_x11_register_xinput):
Disabled the XInput keyboard code paths (comments and #if 0's)
* clutter/x11/clutter-event-x11.c: (event_translate): always handle
keyboard events without regard to XInput.
2008-06-29 Matthew Allum <mallum@openedhand.com>
* clutter/x11/clutter-event-x11.c:
ifdef convert_xdevicekey_to_xkey () with XINPUT check.
(fix via Andy Wingo)
ifdef convert_xdevicekey_to_xkey () with XINPUT check.
(fix via Andy Wingo)
2008-06-29 Tommi Komulainen <tommi.komulainen@iki.fi>

View File

@ -188,6 +188,7 @@ clutter_stage_glx_realize (ClutterActor *actor)
StructureNotifyMask |
FocusChangeMask |
ExposureMask |
KeyPressMask | KeyReleaseMask |
PropertyChangeMask);
#ifdef USE_XINPUT
_clutter_x11_select_events (stage_x11->xwin);

View File

@ -615,7 +615,7 @@ _clutter_x11_register_xinput ()
/* Only want 'raw' devices themselves not virtual ones */
if (info->use == IsXExtensionPointer ||
info->use == IsXExtensionKeyboard ||
/*info->use == IsXExtensionKeyboard || XInput is broken */
info->use == IsXExtensionDevice)
{
clutter_x11_trap_x_errors ();
@ -645,9 +645,10 @@ _clutter_x11_register_xinput ()
device->type = CLUTTER_X11_XINPUT_POINTER_DEVICE;
have_an_xpointer = TRUE;
break;
/* XInput is broken:
case IsXExtensionKeyboard:
device->type = CLUTTER_X11_XINPUT_KEYBOARD_DEVICE;
break;
break;*/
case IsXExtensionDevice:
device->type = CLUTTER_X11_XINPUT_EXTENSION_DEVICE;
break;
@ -667,6 +668,8 @@ _clutter_x11_register_xinput ()
switch (xclass_info->input_class)
{
#if 0
/* We do not do XInput keyboard events yet, since it is broken */
case KeyClass:
DeviceKeyPress (xdevice,
x11b->event_types [CLUTTER_X11_XINPUT_KEY_PRESS_EVENT],
@ -678,6 +681,7 @@ _clutter_x11_register_xinput ()
device->xevent_list [num_events]);
num_events++;
break;
#endif
case ButtonClass:
DeviceButtonPress (xdevice,

View File

@ -570,6 +570,18 @@ event_translate (ClutterBackend *backend,
}
break;
case KeyPress:
event->key.type = event->type = CLUTTER_KEY_PRESS;
translate_key_event (backend, event, xevent);
set_user_time (backend_x11, &xwindow, xevent->xkey.time);
break;
case KeyRelease:
event->key.type = event->type = CLUTTER_KEY_RELEASE;
translate_key_event (backend, event, xevent);
break;
default:
/* ignore every other event */
not_yet_handled = TRUE;
@ -584,18 +596,9 @@ event_translate (ClutterBackend *backend,
/* Regular X event */
switch (xevent->type)
{
case KeyPress:
event->key.type = event->type = CLUTTER_KEY_PRESS;
translate_key_event (backend, event, xevent);
set_user_time (backend_x11, &xwindow, xevent->xkey.time);
break;
case KeyRelease:
event->key.type = event->type = CLUTTER_KEY_RELEASE;
translate_key_event (backend, event, xevent);
break;
/* KeyPress / KeyRelease should reside here if XInput
* worked properly
*/
case ButtonPress:
switch (xevent->xbutton.button)
{
@ -761,6 +764,12 @@ event_translate (ClutterBackend *backend,
xmev->x,
xmev->y);
}
#if 0
/* the Xinput handling of key presses/releases disabled for now since
* it makes keyrepeat, and key presses and releases outside the window
* not generate events even when the window has focus
*/
else if (xevent->type
== ev_types [CLUTTER_X11_XINPUT_KEY_PRESS_EVENT])
{
@ -785,6 +794,7 @@ event_translate (ClutterBackend *backend,
event->key.type = event->type = CLUTTER_KEY_RELEASE;
translate_key_event (backend, event, &xevent_converted);
}
#endif
else
#endif
{