input-device: print device number in debug messages

https://bugzilla.gnome.org/show_bug.cgi?id=684530
This commit is contained in:
Emanuele Aina 2012-09-21 08:05:59 +00:00 committed by Emmanuele Bassi
parent d587fa4e28
commit a6abf86e94
2 changed files with 19 additions and 8 deletions

View File

@ -866,7 +866,8 @@ _clutter_input_device_update (ClutterInputDevice *device,
stage = device->stage; stage = device->stage;
if (G_UNLIKELY (stage == NULL)) if (G_UNLIKELY (stage == NULL))
{ {
CLUTTER_NOTE (EVENT, "No stage defined for device '%s'", CLUTTER_NOTE (EVENT, "No stage defined for device %d '%s'",
clutter_input_device_get_device_id (device),
clutter_input_device_get_device_name (device)); clutter_input_device_get_device_name (device));
return NULL; return NULL;
} }
@ -1570,8 +1571,12 @@ _clutter_input_device_set_associated_device (ClutterInputDevice *device,
if (device->associated != NULL) if (device->associated != NULL)
g_object_ref (device->associated); g_object_ref (device->associated);
CLUTTER_NOTE (MISC, "Associating device '%s' to device '%s'", CLUTTER_NOTE (MISC, "Associating device %d '%s' to device %d '%s'",
clutter_input_device_get_device_id (device),
clutter_input_device_get_device_name (device), clutter_input_device_get_device_name (device),
device->associated != NULL
? clutter_input_device_get_device_id (device->associated)
: -1,
device->associated != NULL device->associated != NULL
? clutter_input_device_get_device_name (device->associated) ? clutter_input_device_get_device_name (device->associated)
: "(none)"); : "(none)");

View File

@ -877,11 +877,12 @@ clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
&xev->valuators); &xev->valuators);
CLUTTER_NOTE (EVENT, CLUTTER_NOTE (EVENT,
"scroll: win:0x%x, device:%s, time:%d " "scroll: win:0x%x, device:%d '%s', time:%d "
"(direction:%s, " "(direction:%s, "
"x:%.2f, y:%.2f, " "x:%.2f, y:%.2f, "
"emulated:%s)", "emulated:%s)",
(unsigned int) stage_x11->xwin, (unsigned int) stage_x11->xwin,
device->id,
device->device_name, device->device_name,
event->any.time, event->any.time,
event->scroll.direction == CLUTTER_SCROLL_UP ? "up" : event->scroll.direction == CLUTTER_SCROLL_UP ? "up" :
@ -929,7 +930,7 @@ clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
&xev->valuators); &xev->valuators);
CLUTTER_NOTE (EVENT, CLUTTER_NOTE (EVENT,
"%s: win:0x%x, device:%s, time:%d " "%s: win:0x%x, device:%d '%s', time:%d "
"(button:%d, " "(button:%d, "
"x:%.2f, y:%.2f, " "x:%.2f, y:%.2f, "
"axes:%s, " "axes:%s, "
@ -938,6 +939,7 @@ clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
? "button press " ? "button press "
: "button release", : "button release",
(unsigned int) stage_x11->xwin, (unsigned int) stage_x11->xwin,
device->id,
device->device_name, device->device_name,
event->any.time, event->any.time,
event->button.button, event->button.button,
@ -999,8 +1001,9 @@ clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
clutter_event_set_device (event, device); clutter_event_set_device (event, device);
CLUTTER_NOTE (EVENT, CLUTTER_NOTE (EVENT,
"smooth scroll: win:0x%x device:%s (x:%.2f, y:%.2f, delta:%f, %f)", "smooth scroll: win:0x%x device:%d '%s' (x:%.2f, y:%.2f, delta:%f, %f)",
(unsigned int) stage_x11->xwin, (unsigned int) stage_x11->xwin,
event->scroll.device->id,
event->scroll.device->device_name, event->scroll.device->device_name,
event->scroll.x, event->scroll.x,
event->scroll.y, event->scroll.y,
@ -1041,8 +1044,9 @@ clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
_clutter_event_set_pointer_emulated (event, TRUE); _clutter_event_set_pointer_emulated (event, TRUE);
#endif /* HAVE_XINPUT_2_2 */ #endif /* HAVE_XINPUT_2_2 */
CLUTTER_NOTE (EVENT, "motion: win:0x%x device:%s (x:%.2f, y:%.2f, axes:%s)", CLUTTER_NOTE (EVENT, "motion: win:0x%x device:%d '%s' (x:%.2f, y:%.2f, axes:%s)",
(unsigned int) stage_x11->xwin, (unsigned int) stage_x11->xwin,
event->motion.device->id,
event->motion.device->device_name, event->motion.device->device_name,
event->motion.x, event->motion.x,
event->motion.y, event->motion.y,
@ -1098,9 +1102,10 @@ clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
if (xev->flags & XITouchEmulatingPointer) if (xev->flags & XITouchEmulatingPointer)
_clutter_event_set_pointer_emulated (event, TRUE); _clutter_event_set_pointer_emulated (event, TRUE);
CLUTTER_NOTE (EVENT, "touch %s: win:0x%x device:%s (seq:%d, x:%.2f, y:%.2f, axes:%s)", CLUTTER_NOTE (EVENT, "touch %s: win:0x%x device:%d '%s' (seq:%d, x:%.2f, y:%.2f, axes:%s)",
event->type == CLUTTER_TOUCH_BEGIN ? "begin" : "end", event->type == CLUTTER_TOUCH_BEGIN ? "begin" : "end",
(unsigned int) stage_x11->xwin, (unsigned int) stage_x11->xwin,
event->touch.device->id,
event->touch.device->device_name, event->touch.device->device_name,
GPOINTER_TO_UINT (event->touch.sequence), GPOINTER_TO_UINT (event->touch.sequence),
event->touch.x, event->touch.x,
@ -1145,8 +1150,9 @@ clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
if (xev->flags & XITouchEmulatingPointer) if (xev->flags & XITouchEmulatingPointer)
_clutter_event_set_pointer_emulated (event, TRUE); _clutter_event_set_pointer_emulated (event, TRUE);
CLUTTER_NOTE (EVENT, "touch update: win:0x%x device:%s (seq:%d, x:%.2f, y:%.2f, axes:%s)", CLUTTER_NOTE (EVENT, "touch update: win:0x%x device:%d '%s' (seq:%d, x:%.2f, y:%.2f, axes:%s)",
(unsigned int) stage_x11->xwin, (unsigned int) stage_x11->xwin,
event->touch.device->id,
event->touch.device->device_name, event->touch.device->device_name,
GPOINTER_TO_UINT (event->touch.sequence), GPOINTER_TO_UINT (event->touch.sequence),
event->touch.x, event->touch.x,