summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-12-06 15:09:27 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-12-17 15:03:36 +1000
commit353aa515922e1095047161ec47a2722772218f20 (patch)
treea57aac8dae8e273e6b8f8ef68095e9dbb4261555 /Xi
parent3b161401700a2d916da0f81f99b39e75fdbe78df (diff)
Xi: deliver barrier events as grabbed events where necessary
If the grab_window is the barrier window and the client owns the grab, deliver as normal grabbed event (respecting owner_events). Otherwise, deliver as usual. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Diffstat (limited to 'Xi')
-rw-r--r--Xi/exevents.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c
index e606d9ea5..a7ec0c415 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1647,6 +1647,7 @@ ProcessBarrierEvent(InternalEvent *e, DeviceIntPtr dev)
BarrierEvent *be = &e->barrier_event;
xEvent *ev;
int rc;
+ GrabPtr grab = dev->deviceGrab.grab;
if (!IsMaster(dev))
return;
@@ -1660,10 +1661,21 @@ ProcessBarrierEvent(InternalEvent *e, DeviceIntPtr dev)
return;
}
- filter = GetEventFilter(dev, ev);
+ /* A client has a grab, deliver to this client if the grab_window is the
+ barrier window.
+
+ Otherwise, deliver normally to the client.
+ */
+ if (grab &&
+ CLIENT_ID(be->barrierid) == CLIENT_ID(grab->resource) &&
+ grab->window->drawable.id == be->window) {
+ DeliverGrabbedEvent(e, dev, FALSE);
+ } else {
+ filter = GetEventFilter(dev, ev);
- DeliverEventsToWindow(dev, pWin, ev, 1,
- filter, NullGrab);
+ DeliverEventsToWindow(dev, pWin, ev, 1,
+ filter, NullGrab);
+ }
free(ev);
}