[PATCH 4/4] dix: only deliver for the current grab type

Peter Hutterer peter.hutterer at who-t.net
Tue Sep 3 22:34:29 PDT 2013


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 at who-t.net>
---
 dix/events.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/dix/events.c b/dix/events.c
index 452fc3b..7a1b1c3 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;
-- 
1.8.3.1



More information about the xorg-devel mailing list