[PATCH 08/12] dix: Don't deliver XI events from MDs.

Peter Hutterer peter.hutterer at who-t.net
Thu Nov 27 23:03:06 PST 2008


From: Peter Hutterer <peter.hutterer at redhat.com>

Restore the XI 1.x event model: VCP/VCK deliver core events only, SDs device
events only.

Signed-off-by: Peter Hutterer <peter.hutterer at redhat.com>
---
 dix/events.c |   62 ++++++++++++++++++---------------------------------------
 1 files changed, 20 insertions(+), 42 deletions(-)

diff --git a/dix/events.c b/dix/events.c
index d1dc8ed..b024d9e 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -2404,31 +2404,29 @@ DeliverDeviceEvents(WindowPtr pWin, xEvent *xE, GrabPtr grab,
 
     while (pWin && type != GenericEvent)
     {
-        /* First try XI event delivery */
-        inputMasks = wOtherInputMasks(pWin);
-        if (inputMasks && (filter & inputMasks->deliverableEvents[mskidx]))
+        if (!dev->isMaster)
         {
-
-            if (inputMasks && (inputMasks->inputEvents[mskidx] & filter))
+            inputMasks = wOtherInputMasks(pWin);
+            if (inputMasks && (filter & inputMasks->deliverableEvents[mskidx]))
             {
-                FixUpEventFromWindow(dev, xE, pWin, child, FALSE);
-                deliveries = DeliverEventsToWindow(dev, pWin, xE, count,
-                                                   filter, grab, mskidx);
-                if (deliveries > 0)
-                    return deliveries;
-            }
 
-            if ((deliveries < 0) ||
-                    (pWin == stopAt) ||
-                    (inputMasks &&
-                     (filter & inputMasks->dontPropagateMask[mskidx])))
-                return 0;
-        }
+                if (inputMasks && (inputMasks->inputEvents[mskidx] & filter))
+                {
+                    FixUpEventFromWindow(dev, xE, pWin, child, FALSE);
+                    deliveries = DeliverEventsToWindow(dev, pWin, xE, count,
+                            filter, grab, mskidx);
+                    if (deliveries > 0)
+                        return deliveries;
+                }
 
-        if (dev->isMaster && dev->coreEvents)
+                if ((deliveries < 0) ||
+                        (pWin == stopAt) ||
+                        (inputMasks &&
+                         (filter & inputMasks->dontPropagateMask[mskidx])))
+                    return 0;
+            }
+        } else
         {
-
-            /* no XI event delivered. Try core event */
             core = *xE;
             core.u.u.type = XItoCoreType(xE->u.u.type);
 
@@ -3621,28 +3619,10 @@ DeliverGrabbedEvent(xEvent *xE, DeviceIntPtr thisDev,
     }
     if (!deliveries)
     {
-        if (xE->u.u.type == GenericEvent)
-        {
-            /* find evmask for event's extension */
-            xGenericEvent* ge = ((xGenericEvent*)xE);
-            GenericMaskPtr    gemask = grab->genericMasks;
-
-            if (!gemask || !gemask->eventMask[GEEXTIDX(ge)])
-                return;
-
-            if (GEEventFill(xE))
-                GEEventFill(xE)(ge, thisDev, grab->window, grab);
-            deliveries = TryClientEvents(rClient(grab), thisDev, xE,
-                    count, gemask->eventMask[GEEXTIDX(ge)],
-                    generic_filters[GEEXTIDX(ge)][ge->evtype],
-                    grab);
-        } else
         {
             Mask mask = grab->eventMask;
 
-            sendCore = (thisDev->isMaster && thisDev->coreEvents);
-            /* try core event */
-            if (sendCore && grab->coreGrab)
+            if (thisDev->isMaster)
             {
                 core = *xE;
                 core.u.u.type = XItoCoreType(xE->u.u.type);
@@ -3663,9 +3643,7 @@ DeliverGrabbedEvent(xEvent *xE, DeviceIntPtr thisDev,
                                 grab);
                     }
                 }
-            }
-
-            if (!deliveries)
+            } else
             {
                 /* try XI event */
                 if (grabinfo->fromPassiveGrab  &&
-- 
1.6.0.3




More information about the xorg mailing list