event: Typos in event code could cause crashes
authorChris Lord <chris@linux.intel.com>
Tue, 29 Jun 2010 14:30:25 +0000 (15:30 +0100)
committerChris Lord <chris@linux.intel.com>
Tue, 29 Jun 2010 14:42:59 +0000 (15:42 +0100)
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).

clutter/clutter-event.c
clutter/x11/clutter-event-x11.c

index 4eec220..d6755cb 100644 (file)
@@ -575,7 +575,7 @@ clutter_event_get_device (ClutterEvent *event)
 
     case CLUTTER_KEY_PRESS:
     case CLUTTER_KEY_RELEASE:
-      device = event->scroll.device;
+      device = event->key.device;
       break;
     }
 
index 1a465a3..28bb4b3 100644 (file)
@@ -667,7 +667,7 @@ event_translate (ClutterBackend *backend,
       event->key.type = event->type = CLUTTER_KEY_PRESS;
       event->key.device =
         clutter_device_manager_get_core_device (manager,
-                                                CLUTTER_POINTER_DEVICE);
+                                                CLUTTER_KEYBOARD_DEVICE);
 
       translate_key_event (backend, event, xevent);