backend: gdk: add translation code for touch events

https://bugzilla.gnome.org/show_bug.cgi?id=734934
This commit is contained in:
Lionel Landwerlin 2014-08-16 19:39:46 +01:00
parent be8602fbb4
commit ccd2054fda

View File

@ -184,6 +184,33 @@ clutter_gdk_handle_event (GdkEvent *gdk_event)
event->button.y); event->button.y);
break; break;
case GDK_TOUCH_BEGIN:
case GDK_TOUCH_END:
case GDK_TOUCH_CANCEL:
case GDK_TOUCH_UPDATE:
event = clutter_event_new (gdk_event->type == GDK_TOUCH_BEGIN ?
CLUTTER_TOUCH_BEGIN :
((gdk_event->type == GDK_TOUCH_END) ?
CLUTTER_TOUCH_END :
(gdk_event->type == GDK_TOUCH_UPDATE ?
CLUTTER_TOUCH_UPDATE :
CLUTTER_TOUCH_CANCEL)));
event->touch.time = gdk_event->touch.time;
event->touch.x = gdk_event->touch.x;
event->touch.y = gdk_event->touch.y;
event->touch.sequence = (ClutterEventSequence *) gdk_event->touch.sequence;
event->touch.modifier_state = gdk_event->touch.state;
clutter_event_set_device (event, device);
clutter_event_set_source_device (event, source_device);
CLUTTER_NOTE (EVENT, "Touch %p %s [%",
event->touch.sequence,
event->type == CLUTTER_TOUCH_BEGIN ? "begin" :
(event->type == CLUTTER_TOUCH_END ? "end" :
(event->type == CLUTTER_TOUCH_UPDATE ? "update"
: "cancel")),
event->touch.x, event->touch.y);
break;
case GDK_2BUTTON_PRESS: case GDK_2BUTTON_PRESS:
case GDK_3BUTTON_PRESS: case GDK_3BUTTON_PRESS:
/* these are handled by clutter-main.c updating click_count */ /* these are handled by clutter-main.c updating click_count */