Imported Debian patch 2:1.11.4-0ubuntu10.1
[glsdk/xserver.git] / debian / patches / 506_touchscreen_pointer_emulation_checks.patch
index 11a9ea203cf2cf339a361b83d9dafee6fa6178f1..c6fcac8db809983dade30ba5671487a64ae14cca 100644 (file)
@@ -1,46 +1,48 @@
-From c149cf06d1966d134073d4b33f2ec028fbf7bbd1 Mon Sep 17 00:00:00 2001
+From ec9c4295830c3de610e65aca17f4da4a7af3c4c5 Mon Sep 17 00:00:00 2001
 From: Chase Douglas <chase.douglas@canonical.com>
-Date: Wed, 4 Apr 2012 12:41:59 -0700
-Subject: [PATCH 1/3] Don't attempt to add non-master core touch pointer
- emulation listeners
+Date: Wed, 18 Apr 2012 12:04:58 -0700
+Subject: [PATCH] Check other clients' core masks properly when adding touch
+ listener
 
-Core events aren't generated for slave devices, so this is just wrong.
-On top of that, the mask being checked in the removed hunk is wrong as
-well. It is dereferencing a pointer of type OtherClients as though it
-were a pointer to type InputClients.
+The current code checks the core event mask as though it were an XI
+mask. This change fixes the checks so the proper client and event masks
+are used.
 
 Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
-
-Conflicts:
-
-       dix/touch.c
+Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
 ---
- dix/touch.c |   12 ------------
- 1 files changed, 0 insertions(+), 12 deletions(-)
+ dix/touch.c |    8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
 
 diff --git a/dix/touch.c b/dix/touch.c
-index d04801c..87b0f15 100644
+index 572bdfb..f8f26c8 100644
 --- a/dix/touch.c
 +++ b/dix/touch.c
-@@ -853,18 +853,6 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
-                              win);
-             return TRUE;
+@@ -811,6 +811,7 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
+     if (mask & EVENT_CORE_MASK) {
+         int coretype = GetCoreType(TouchGetPointerEventType(ev));
+         Mask core_filter = event_get_filter_from_type(dev, coretype);
++        OtherClients *oclients;
+         /* window owner */
+         if (IsMaster(dev) && (win->eventMask & core_filter)) {
+@@ -822,13 +823,12 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
          }
--
--        /* all others */
+         /* all others */
 -        nt_list_for_each_entry(iclients, (InputClients*)wOtherClients(win), next)
 -        {
 -            if (!(iclients->mask[XIAllDevices] & core_filter))
--                continue;
--
--            TouchEventHistoryAllocate(ti);
--            TouchAddListener(ti, iclients->resource, CORE,
--                             type, LISTENER_AWAITING_BEGIN, win);
--            return TRUE;
--        }
-     }
++        nt_list_for_each_entry(oclients, wOtherClients(win), next) {
++            if (!(oclients->mask & core_filter))
+                 continue;
  
-     return FALSE;
+             TouchEventHistoryAllocate(ti);
+-            TouchAddListener(ti, iclients->resource, CORE,
++            TouchAddListener(ti, oclients->resource, CORE,
+                              type, LISTENER_AWAITING_BEGIN, win);
+             return TRUE;
+         }
 -- 
 1.7.9.1