[clutter/clutter-1.18] x11: Set the input device stage on XI_TouchBegin, if not already set



commit 0be75171aced7805891489063039f79239dfb02e
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Jun 25 12:59:34 2014 +0200

    x11: Set the input device stage on XI_TouchBegin, if not already set
    
    Until now, touch events sort of rely on XI_Enter/XI_Leave events accompanying
    the pointer emulating touch in order to have a stage set on the device, These
    events won't happen though if it's not a pointer emulating touch which happens
    on the stage, causing touch events to be ignored.
    
    Fix this by ensuring that the input device has a stage on XI_TouchBegin itself,
    but only if it's not already set, so we don't possibly steal touch events to
    an already interacting stage.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=732234
    (cherry picked from commit 4c4e72a9dc3674774a8d38054a4bb8b95fdd972b)
    Signed-off-by: Emmanuele Bassi <ebassi gnome org>

 clutter/x11/clutter-device-manager-xi2.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/clutter/x11/clutter-device-manager-xi2.c b/clutter/x11/clutter-device-manager-xi2.c
index 2c8ced8..5eb64c0 100644
--- a/clutter/x11/clutter-device-manager-xi2.c
+++ b/clutter/x11/clutter-device-manager-xi2.c
@@ -1155,6 +1155,14 @@ clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
 
 #ifdef HAVE_XINPUT_2_2
     case XI_TouchBegin:
+      {
+        XIDeviceEvent *xev = (XIDeviceEvent *) xi_event;
+        device = g_hash_table_lookup (manager_xi2->devices_by_id,
+                                      GINT_TO_POINTER (xev->deviceid));
+        if (!_clutter_input_device_get_stage (device))
+          _clutter_input_device_set_stage (device, stage);
+      }
+      /* Fall through */
     case XI_TouchEnd:
       {
         XIDeviceEvent *xev = (XIDeviceEvent *) xi_event;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]