From c7ff2b76516510b06cb7b3312b2ef8e76a47024f Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 17 Sep 2007 11:34:03 +0000 Subject: [PATCH] 2007-09-17 Emmanuele Bassi Merge from stable * clutter/eglnative/clutter-event-egl.c: Flag every device click after the first as motion events instead of button presses. (#505, Shreyas Srinivasan) --- ChangeLog | 8 ++++++++ clutter/eglnative/clutter-event-egl.c | 20 ++++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index d044ce458..77732d901 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-09-17 Emmanuele Bassi + + Merge from stable + + * clutter/eglnative/clutter-event-egl.c: + Flag every device click after the first as motion events + instead of button presses. (#505, Shreyas Srinivasan) + 2007-09-10 Matthew Allum Port from stable branch. diff --git a/clutter/eglnative/clutter-event-egl.c b/clutter/eglnative/clutter-event-egl.c index 1f15caee2..d36bc673f 100644 --- a/clutter/eglnative/clutter-event-egl.c +++ b/clutter/eglnative/clutter-event-egl.c @@ -191,11 +191,13 @@ clutter_event_dispatch (GSource *source, struct ts_sample tsevent; #endif ClutterMainContext *clutter_context; - static gint last_x, last_y; + static gint last_x = 0, last_y = 0; + static gboolean clicked = FALSE; clutter_threads_enter (); clutter_context = clutter_context_get_default (); + #ifdef HAVE_TSLIB /* FIXME while would be better here but need to deal with lockups */ if ((!clutter_events_pending()) && @@ -218,10 +220,20 @@ clutter_event_dispatch (GSource *source, event->button.modifier_state = 0; event->button.button = 1; - if (tsevent.pressure) - event->button.type = event->type = CLUTTER_BUTTON_PRESS; + if (tsevent.pressure && !clicked) + { + event->button.type = event->type = CLUTTER_BUTTON_PRESS; + clicked = TRUE; + } + else if (tsevent.pressure && clicked) + { + event->motion.type = event->type = CLUTTER_MOTION; + } else - event->button.type = event->type = CLUTTER_BUTTON_RELEASE; + { + event->button.type = event->type = CLUTTER_BUTTON_RELEASE; + clicked = FALSE; + } _clutter_event_button_generate (backend, event);