summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2013-09-04 15:34:29 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2013-10-14 11:07:38 +1000
commit7cf1b595c8c8f9776a39559d2878cf90af3f2859 (patch)
tree12781fea9562c10dd62daa8c546ebfbe02a67768 /dix
parent78944d62ffc7fec6f75b6f514ab7a139ba9bc77b (diff)
dix: only deliver for the current grab type
Use the grabtype to determine which type of event to send - all other events are pointless and may result in erroneous events being delivered. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'dix')
-rw-r--r--dix/events.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/dix/events.c b/dix/events.c
index 452fc3ba6..7a1b1c3c6 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -4256,17 +4256,8 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev,
sendCore = (IsMaster(thisDev) && thisDev->coreEvents);
/* try core event */
- if (sendCore && grab->grabtype == CORE) {
- deliveries = DeliverOneGrabbedEvent(event, thisDev, CORE);
- }
-
- if (!deliveries) {
- deliveries = DeliverOneGrabbedEvent(event, thisDev, XI2);
- }
-
- if (!deliveries) {
- deliveries = DeliverOneGrabbedEvent(event, thisDev, XI);
- }
+ if ((sendCore && grab->grabtype == CORE) || grab->grabtype != CORE)
+ deliveries = DeliverOneGrabbedEvent(event, thisDev, grab->grabtype);
if (deliveries && (event->any.type == ET_Motion))
thisDev->valuator->motionHintWindow = grab->window;