summaryrefslogtreecommitdiff
path: root/dix/events.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-12-19 12:09:31 -0800
committerKeith Packard <keithp@keithp.com>2012-12-19 12:09:31 -0800
commit014a5c8a9d86f2f992183bff9106354fac2c3b0e (patch)
treee848fd6eb03079d6e3e8b69ba1b4237066e23749 /dix/events.c
parentf793b5fd3eb16a2ada130367c2ffebeede69a322 (diff)
parent2eefa5d6e870c57ac6a5930883d8cfe3a3882a43 (diff)
Merge remote-tracking branch 'whot/barriers'
Conflicts: Xi/xichangehierarchy.c Small conflict with the patch from Xi: don't use devices after removing them Was easily resolved by hand. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'dix/events.c')
-rw-r--r--dix/events.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/dix/events.c b/dix/events.c
index 3836d2f17..73593626e 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);
@@ -2092,6 +2095,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))
@@ -2446,6 +2452,8 @@ FixUpEventFromWindow(SpritePtr pSprite,
case XI_DeviceChanged:
case XI_HierarchyChanged:
case XI_PropertyEvent:
+ case XI_BarrierHit:
+ case XI_BarrierLeave:
return;
default:
break;
@@ -6080,3 +6088,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);
+}