x11: Fill out the :name property of the InputDevices
authorEmmanuele Bassi <ebassi@linux.intel.com>
Fri, 15 Jan 2010 11:38:58 +0000 (11:38 +0000)
committerEmmanuele Bassi <ebassi@linux.intel.com>
Wed, 20 Jan 2010 00:38:09 +0000 (00:38 +0000)
For the core pointer and keyboard we assign the names ourselves; for
devices coming from XI we can use the XDeviceInfo.name member.

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

index 08d9da9..523d476 100644 (file)
@@ -174,6 +174,7 @@ clutter_x11_register_input_devices (ClutterBackendX11 *backend)
           device = g_object_new (CLUTTER_TYPE_INPUT_DEVICE_X11,
                                  "id", info->id,
                                  "device-type", device_type,
+                                 "name", info->name,
                                  NULL);
           n_events = _clutter_input_device_x11_construct (device, backend);
 
@@ -226,7 +227,7 @@ default_device:
    *  - we do not have the XInput extension
    *  - we do not have a XInput pointer device
    *
-   * we register two default devices, one for the pointer
+   * we register two default core devices, one for the pointer
    * and one for the keyboard
    */
   if (!have_an_xpointer)
@@ -235,6 +236,7 @@ default_device:
 
       d = g_object_new (CLUTTER_TYPE_INPUT_DEVICE_X11,
                         "id", 0,
+                        "name", "Core Pointer",
                         "device-type", CLUTTER_POINTER_DEVICE,
                         "is-core", TRUE,
                         NULL);
@@ -245,6 +247,7 @@ default_device:
 
       d = g_object_new (CLUTTER_TYPE_INPUT_DEVICE_X11,
                         "id", 1,
+                        "name", "Core Keyboard",
                         "device-type", CLUTTER_KEYBOARD_DEVICE,
                         "is-core", TRUE,
                         NULL);
index 87a21f5..d6be645 100644 (file)
@@ -810,8 +810,9 @@ event_translate (ClutterBackend *backend,
               device = _clutter_x11_get_device_for_xid (xbev->deviceid);
 
               CLUTTER_NOTE (EVENT,
-                            "XINPUT Button press event for %li at %d, %d",
+                            "XI ButtonPress for %li ('%s') at %d, %d",
                             xbev->deviceid,
+                            device->device_name,
                             xbev->x,
                             xbev->y);
 
@@ -858,8 +859,9 @@ event_translate (ClutterBackend *backend,
 
               device = _clutter_x11_get_device_for_xid (xbev->deviceid);
 
-              CLUTTER_NOTE (EVENT, "XINPUT Button release event for %li at %d, %d",
+              CLUTTER_NOTE (EVENT, "XI ButtonRelease for %li ('%s') at %d, %d",
                             xbev->deviceid,
+                            device->device_name,
                             xbev->x,
                             xbev->y);
 
@@ -886,8 +888,9 @@ event_translate (ClutterBackend *backend,
 
               device = _clutter_x11_get_device_for_xid (xmev->deviceid);
 
-              CLUTTER_NOTE(EVENT, "XINPUT Motion event for %li at %d, %d",
+              CLUTTER_NOTE(EVENT, "XI Motion for %li ('%s') at %d, %d",
                            xmev->deviceid,
+                           device->device_name,
                            xmev->x,
                            xmev->y);