event: Typos in event code could cause crashes

A typo in clutter-event.c meant that the wrong struct location could be
used for the input device of key events. Also, a typo in the X11 event
code meant that key-presses would come from the pointer device (releases
would still come from the keyboard device).
This commit is contained in:
Chris Lord 2010-06-29 15:30:25 +01:00
parent 32ad63efef
commit 8801c947d5
2 changed files with 2 additions and 2 deletions

View File

@ -575,7 +575,7 @@ clutter_event_get_device (ClutterEvent *event)
case CLUTTER_KEY_PRESS: case CLUTTER_KEY_PRESS:
case CLUTTER_KEY_RELEASE: case CLUTTER_KEY_RELEASE:
device = event->scroll.device; device = event->key.device;
break; break;
} }

View File

@ -667,7 +667,7 @@ event_translate (ClutterBackend *backend,
event->key.type = event->type = CLUTTER_KEY_PRESS; event->key.type = event->type = CLUTTER_KEY_PRESS;
event->key.device = event->key.device =
clutter_device_manager_get_core_device (manager, clutter_device_manager_get_core_device (manager,
CLUTTER_POINTER_DEVICE); CLUTTER_KEYBOARD_DEVICE);
translate_key_event (backend, event, xevent); translate_key_event (backend, event, xevent);