x11: Add extra debug spew on XI2 crossing and button events

This information will be useful in case someone stumbles on a situation
similar to https://bugzilla.gnome.org/show_bug.cgi?id=699574, so we can
figure out where do the crossing events come from or go to easily.
This commit is contained in:
Carlos Garnacho 2013-11-17 00:14:06 +01:00
parent 4168c3cab9
commit 962415aeb7

View File

@ -1221,6 +1221,15 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
XIDeviceEvent *xev = (XIDeviceEvent *) ev;
GdkDevice *source_device;
GDK_NOTE (EVENTS,
g_message ("button %s:\twindow %ld\n\tdevice:%u\n"
"\tsource device:%u\n\tbutton number: %u\n"
"\tx,y: %.2f %.2f",
(ev->evtype == XI_ButtonPress) ? "press" : "release",
xev->event, xev->detail,
xev->deviceid, xev->sourceid,
xev->event_x, xev->event_y));
if (ev->evtype == XI_ButtonRelease &&
(xev->detail >= 4 && xev->detail <= 7))
return FALSE;
@ -1547,6 +1556,15 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
XIEnterEvent *xev = (XIEnterEvent *) ev;
GdkDevice *device, *source_device;
GDK_NOTE (EVENTS,
g_message ("%s notify:\twindow %ld\n\tsubwindow:%ld\n"
"\tdevice: %u\n\tsource device: %u\n"
"\tnotify type: %u\n\tcrossing mode: %u",
(ev->evtype == XI_Enter) ? "enter" : "leave",
xev->event, xev->child,
xev->deviceid, xev->sourceid,
xev->detail, xev->mode));
event->crossing.type = (ev->evtype == XI_Enter) ? GDK_ENTER_NOTIFY : GDK_LEAVE_NOTIFY;
event->crossing.x = (gdouble) xev->event_x / scale;