app: gimp_print_event(): add the device to the event debug output.

This commit is contained in:
Michael Natterer 2011-02-27 15:59:07 +01:00
parent f85ceecf28
commit 09b9263d5c
1 changed files with 12 additions and 2 deletions

View File

@ -1527,15 +1527,18 @@ const gchar *
gimp_print_event (const GdkEvent *event)
{
gchar *str;
gchar *tmp;
switch (event->type)
{
case GDK_ENTER_NOTIFY:
str = g_strdup ("ENTER_NOTIFY");
str = g_strdup_printf ("ENTER_NOTIFY (mode %d)",
event->crossing.mode);
break;
case GDK_LEAVE_NOTIFY:
str = g_strdup ("LEAVE_NOTIFY");
str = g_strdup_printf ("LEAVE_NOTIFY (mode %d)",
event->crossing.mode);
break;
case GDK_PROXIMITY_IN:
@ -1613,6 +1616,13 @@ gimp_print_event (const GdkEvent *event)
break;
}
tmp = g_strdup_printf ("%s (device '%s', source device '%s')",
str,
gdk_device_get_name (gdk_event_get_device (event)),
gdk_device_get_name (gdk_event_get_source_device (event)));
g_free (str);
str = tmp;
g_idle_add (gimp_print_event_free, str);
return str;