[PATCH 1/5] Store window pointer in touch listener record

Chase Douglas chase.douglas at canonical.com
Thu Feb 2 16:57:54 PST 2012


From: Chase Douglas <chase.douglas at ubuntu.com>

Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
---
 dix/touch.c        |   16 ++++++++++------
 include/input.h    |    3 ++-
 include/inputstr.h |    1 +
 3 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/dix/touch.c b/dix/touch.c
index db0bf33..b42859d 100644
--- a/dix/touch.c
+++ b/dix/touch.c
@@ -697,12 +697,14 @@ TouchResourceIsOwner(TouchPointInfoPtr ti, XID resource)
  */
 void
 TouchAddListener(TouchPointInfoPtr ti, XID resource, enum InputLevel level,
-                 enum TouchListenerType type, enum TouchListenerState state)
+                 enum TouchListenerType type, enum TouchListenerState state,
+                 WindowPtr window)
 {
     ti->listeners[ti->num_listeners].listener = resource;
     ti->listeners[ti->num_listeners].level = level;
     ti->listeners[ti->num_listeners].state = state;
     ti->listeners[ti->num_listeners].type = type;
+    ti->listeners[ti->num_listeners].window = window;
     ti->num_listeners++;
 }
 
@@ -753,7 +755,7 @@ TouchAddGrabListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
     }
 
     TouchAddListener(ti, grab->resource, grab->grabtype,
-                     type, LISTENER_AWAITING_BEGIN);
+                     type, LISTENER_AWAITING_BEGIN, grab->window);
     ti->num_grabs++;
 }
 
@@ -814,7 +816,7 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
                 TouchEventHistoryAllocate(ti);
 
             TouchAddListener(ti, iclients->resource, XI2,
-                             type, LISTENER_AWAITING_BEGIN);
+                             type, LISTENER_AWAITING_BEGIN, win);
             return TRUE;
         }
     }
@@ -830,7 +832,8 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
 
             TouchEventHistoryAllocate(ti);
             TouchAddListener(ti, iclients->resource, XI,
-                             LISTENER_POINTER_REGULAR, LISTENER_AWAITING_BEGIN);
+                             LISTENER_POINTER_REGULAR, LISTENER_AWAITING_BEGIN,
+                             win);
             return TRUE;
         }
     }
@@ -845,7 +848,8 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
         {
             TouchEventHistoryAllocate(ti);
             TouchAddListener(ti, win->drawable.id, CORE,
-                             LISTENER_POINTER_REGULAR, LISTENER_AWAITING_BEGIN);
+                             LISTENER_POINTER_REGULAR, LISTENER_AWAITING_BEGIN,
+                             win);
             return TRUE;
         }
 
@@ -857,7 +861,7 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
 
             TouchEventHistoryAllocate(ti);
             TouchAddListener(ti, iclients->resource, CORE,
-                             type, LISTENER_AWAITING_BEGIN);
+                             type, LISTENER_AWAITING_BEGIN, win);
             return TRUE;
         }
     }
diff --git a/include/input.h b/include/input.h
index fb45617..53645b4 100644
--- a/include/input.h
+++ b/include/input.h
@@ -613,7 +613,8 @@ extern void TouchEventHistoryPush(TouchPointInfoPtr ti, const DeviceEvent *ev);
 extern void TouchEventHistoryReplay(TouchPointInfoPtr ti, DeviceIntPtr dev, XID resource);
 extern Bool TouchResourceIsOwner(TouchPointInfoPtr ti, XID resource);
 extern void TouchAddListener(TouchPointInfoPtr ti, XID resource, enum InputLevel level,
-                                     enum TouchListenerType type, enum TouchListenerState state);
+                             enum TouchListenerType type, enum TouchListenerState state,
+                             WindowPtr window);
 extern Bool TouchRemoveListener(TouchPointInfoPtr ti, XID resource);
 extern void TouchSetupListeners(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev);
 extern Bool TouchEnsureSprite(DeviceIntPtr sourcedev, TouchPointInfoPtr ti,
diff --git a/include/inputstr.h b/include/inputstr.h
index c3297db..4e28bc7 100644
--- a/include/inputstr.h
+++ b/include/inputstr.h
@@ -314,6 +314,7 @@ typedef struct _TouchPointInfo {
         enum TouchListenerType type;
         enum TouchListenerState state;
         enum InputLevel level;      /* matters only for emulating touches */
+        WindowPtr window;
     } *listeners;
     int         num_listeners;
     int         num_grabs;          /* number of open grabs on this touch
-- 
1.7.8.3



More information about the xorg-devel mailing list