From 8a692103633d5af3245bd758873f26619a92dece Mon Sep 17 00:00:00 2001 From: Emanuele Aina Date: Wed, 12 Sep 2012 14:22:30 +0200 Subject: [PATCH] tests: track touch events in test-events Enable xinput support in the X11 backend form test-events to receive touch[begin|update|end] events. https://bugzilla.gnome.org/show_bug.cgi?id=683869 --- tests/interactive/test-events.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/interactive/test-events.c b/tests/interactive/test-events.c index de327c564..944eb6fe5 100644 --- a/tests/interactive/test-events.c +++ b/tests/interactive/test-events.c @@ -33,6 +33,18 @@ get_event_type_name (const ClutterEvent *event) case CLUTTER_DELETE: return "DELETE"; + case CLUTTER_TOUCH_BEGIN: + return "TOUCH BEGIN"; + + case CLUTTER_TOUCH_UPDATE: + return "TOUCH UPDATE"; + + case CLUTTER_TOUCH_END: + return "TOUCH END"; + + case CLUTTER_TOUCH_CANCEL: + return "TOUCH CANCEL"; + default: return "EVENT"; } @@ -229,6 +241,18 @@ input_cb (ClutterActor *actor, clutter_actor_get_parent (actor) == stage) clutter_stage_set_key_focus (CLUTTER_STAGE (stage), actor); break; + case CLUTTER_TOUCH_BEGIN: + g_print ("[%s] TOUCH BEGIN", + clutter_actor_get_name (source_actor)); + break; + case CLUTTER_TOUCH_UPDATE: + g_print ("[%s] TOUCH UPDATE", + clutter_actor_get_name (source_actor)); + break; + case CLUTTER_TOUCH_END: + g_print ("[%s] TOUCH END", + clutter_actor_get_name (source_actor)); + break; case CLUTTER_SCROLL: g_print ("[%s] BUTTON SCROLL (direction:%s)", clutter_actor_get_name (source_actor), @@ -265,6 +289,10 @@ test_events_main (int argc, char *argv[]) { ClutterActor *stage, *actor, *focus_box, *group; +#ifdef CLUTTER_WINDOWING_X11 + clutter_x11_enable_xinput (); +#endif + if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS) return 1;