[PATCH 19/29] dix: skip delivery if it's not the right pointer barrier client

Peter Hutterer peter.hutterer at who-t.net
Tue Dec 11 23:19:12 PST 2012


Only deliver to the client that created the barrier, not to other clients.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 dix/events.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/dix/events.c b/dix/events.c
index 3282ef8..49b8bc5 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -219,6 +219,9 @@ static void CheckVirtualMotion(DeviceIntPtr pDev, QdEventPtr qe,
 static void CheckPhysLimits(DeviceIntPtr pDev, CursorPtr cursor,
                             Bool generateEvents, Bool confineToScreen,
                             ScreenPtr pScreen);
+static Bool IsWrongPointerBarrierClient(ClientPtr client,
+                                        DeviceIntPtr dev,
+                                        xEvent *event);
 
 /** Key repeat hack. Do not use but in TryClientEvents */
 extern BOOL EventIsKeyRepeat(xEvent *event);
@@ -2076,6 +2079,9 @@ DeliverEventToInputClients(DeviceIntPtr dev, InputClients * inputclients,
         if (IsInterferingGrab(client, dev, events))
             continue;
 
+        if (IsWrongPointerBarrierClient(client, dev, events))
+            continue;
+
         mask = GetEventMask(dev, events, inputclients);
 
         if (XaceHook(XACE_RECEIVE_ACCESS, client, win, events, count))
@@ -6064,3 +6070,19 @@ IsInterferingGrab(ClientPtr client, DeviceIntPtr dev, xEvent *event)
 
     return FALSE;
 }
+
+/* PointerBarrier events are only delivered to the client that created that
+ * barrier */
+static Bool
+IsWrongPointerBarrierClient(ClientPtr client, DeviceIntPtr dev, xEvent *event)
+{
+    xXIBarrierEvent *ev = (xXIBarrierEvent*)event;
+
+    if (ev->type != GenericEvent || ev->extension != IReqCode)
+        return FALSE;
+
+    if (ev->evtype != XI_BarrierHit && ev->evtype != XI_BarrierLeave)
+        return FALSE;
+
+    return client->index != CLIENT_ID(ev->barrier);
+}
-- 
1.8.0.1



More information about the xorg-devel mailing list