xserver: Branch 'mpx' - 6 commits

Peter Hutterer whot at kemper.freedesktop.org
Mon Jul 9 18:00:18 PDT 2007


 Xext/Makefile.am    |    2 
 Xext/geext.c        |   14 +++---
 Xext/geext.h        |   16 ++++++
 Xi/chaccess.c       |    8 +--
 Xi/exevents.c       |    2 
 Xi/extgrbdev.c      |   22 ++-------
 Xi/qryacces.c       |    8 +--
 dix/events.c        |  121 ++++++++++++++++++++++++++++++++--------------------
 dix/window.c        |    3 -
 include/dix.h       |    1 
 include/inputstr.h  |    9 ---
 include/misc.h      |    1 
 include/windowstr.h |   22 ++++-----
 13 files changed, 131 insertions(+), 98 deletions(-)

New commits:
diff-tree 583e988b9f7cfb9293144c8309023c0dd1766715 (from 9809715afaafee9baf2aef348c1ebda7e8b3f076)
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Tue Jul 10 09:19:02 2007 +0930

    Install geext.h, otherwise drivers won't build.

diff --git a/Xext/Makefile.am b/Xext/Makefile.am
index 2fcac89..cdfd0dc 100644
--- a/Xext/Makefile.am
+++ b/Xext/Makefile.am
@@ -15,7 +15,7 @@ INCLUDES = -I$(top_srcdir)/hw/xfree86/di
 AM_CFLAGS = $(DIX_CFLAGS)
 
 if XORG
-sdk_HEADERS = xvdix.h xvmcext.h
+sdk_HEADERS = xvdix.h xvmcext.h geext.h
 endif
 
 # Sources always included in libXextbuiltin.la & libXext.la
diff-tree 9809715afaafee9baf2aef348c1ebda7e8b3f076 (from 62efc3951a96648cf975302aa6651cb67b87fa64)
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Mon Jul 9 10:42:03 2007 +0930

    Change CheckMotion to ignore non-pointer events but acknowledge XI events.
    
    Call CheckMotion from ProcessOtherEvents() to make sure absolute XI events
    update the sprite before an event is sent.

diff --git a/Xi/exevents.c b/Xi/exevents.c
index c13b747..8f60561 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -129,6 +129,8 @@ ProcessOtherEvent(xEventPtr xE, DeviceIn
     if (grab && grab->coreGrab && !device->deviceGrab.fromPassiveGrab)
         return;
 
+    CheckMotion(xE, device);
+
     if (xE->u.u.type != DeviceValuator && xE->u.u.type != GenericEvent) {
         DeviceIntPtr mouse = NULL, kbd = NULL;
 	GetSpritePosition(device, &rootX, &rootY);
diff --git a/dix/events.c b/dix/events.c
index 8fcbec7..097ebba 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -2449,10 +2449,16 @@ XYToWindow(DeviceIntPtr pDev, int x, int
  * position, then update the event with the new coordinates that may have been
  * changed. If the window underneath the sprite has changed, change to new
  * cursor and send enter/leave events.
+ *
+ * CheckMotion() will not do anything and return FALSE if the event is not a
+ * pointer event.
+ *
+ * @return TRUE if the sprite has moved or FALSE otherwise. 
  */
 Bool
 CheckMotion(xEvent *xE, DeviceIntPtr pDev)
 {
+    INT16     *rootX, *rootY;
     WindowPtr prevSpriteWin;
     SpritePtr pSprite = pDev->spriteInfo->sprite;
         
@@ -2465,21 +2471,44 @@ CheckMotion(xEvent *xE, DeviceIntPtr pDe
 
     if (xE && !syncEvents.playingEvents)
     {
-	if (pSprite->hot.pScreen != pSprite->hotPhys.pScreen)
-	{
-	    pSprite->hot.pScreen = pSprite->hotPhys.pScreen;
-	    RootWindow(pDev) = WindowTable[pSprite->hot.pScreen->myNum];
-	}
-	pSprite->hot.x = XE_KBPTR.rootX;
-	pSprite->hot.y = XE_KBPTR.rootY;
-	if (pSprite->hot.x < pSprite->physLimits.x1)
-	    pSprite->hot.x = pSprite->physLimits.x1;
-	else if (pSprite->hot.x >= pSprite->physLimits.x2)
-	    pSprite->hot.x = pSprite->physLimits.x2 - 1;
-	if (pSprite->hot.y < pSprite->physLimits.y1)
-	    pSprite->hot.y = pSprite->physLimits.y1;
-	else if (pSprite->hot.y >= pSprite->physLimits.y2)
-	    pSprite->hot.y = pSprite->physLimits.y2 - 1;
+        /* GetPointerEvents() guarantees that pointer events have the correct
+           rootX/Y set already. */
+        switch(xE->u.u.type)
+        {
+            case ButtonPress:
+            case ButtonRelease:
+            case MotionNotify:
+                rootX = &XE_KBPTR.rootX;
+                rootY = &XE_KBPTR.rootY;
+                break;
+            default:
+                if (xE->u.u.type == DeviceButtonPress ||
+                        xE->u.u.type == DeviceButtonRelease ||
+                        xE->u.u.type == DeviceMotionNotify)
+                {
+                    rootX = &((deviceKeyButtonPointer*)xE)->root_x;
+                    rootY = &((deviceKeyButtonPointer*)xE)->root_y;
+                    break;
+                }
+                /* all other events return FALSE */
+                return FALSE;
+        }
+
+        if (pSprite->hot.pScreen != pSprite->hotPhys.pScreen)
+        {
+            pSprite->hot.pScreen = pSprite->hotPhys.pScreen;
+            RootWindow(pDev) = WindowTable[pSprite->hot.pScreen->myNum];
+        }
+        pSprite->hot.x = *rootX;
+        pSprite->hot.y = *rootY;
+        if (pSprite->hot.x < pSprite->physLimits.x1)
+            pSprite->hot.x = pSprite->physLimits.x1;
+        else if (pSprite->hot.x >= pSprite->physLimits.x2)
+            pSprite->hot.x = pSprite->physLimits.x2 - 1;
+        if (pSprite->hot.y < pSprite->physLimits.y1)
+            pSprite->hot.y = pSprite->physLimits.y1;
+        else if (pSprite->hot.y >= pSprite->physLimits.y2)
+            pSprite->hot.y = pSprite->physLimits.y2 - 1;
 #ifdef SHAPE
 	if (pSprite->hotShape)
 	    ConfineToShape(pDev, pSprite->hotShape, &pSprite->hot.x, &pSprite->hot.y);
@@ -2490,16 +2519,16 @@ CheckMotion(xEvent *xE, DeviceIntPtr pDe
 #endif
 	pSprite->hotPhys = pSprite->hot;
 
-	if ((pSprite->hotPhys.x != XE_KBPTR.rootX) ||
-	    (pSprite->hotPhys.y != XE_KBPTR.rootY))
+	if ((pSprite->hotPhys.x != *rootX) ||
+	    (pSprite->hotPhys.y != *rootY))
 	{
 	    (*pSprite->hotPhys.pScreen->SetCursorPosition)(
                 pDev, pSprite->hotPhys.pScreen,
 		pSprite->hotPhys.x, pSprite->hotPhys.y, FALSE);
 	}
 
-	XE_KBPTR.rootX = pSprite->hot.x;
-	XE_KBPTR.rootY = pSprite->hot.y;
+	*rootX = pSprite->hot.x;
+	*rootY = pSprite->hot.y;
     }
 
 #ifdef XEVIE
@@ -3635,9 +3664,8 @@ ProcessPointerEvent (xEvent *xE, DeviceI
 	}
     }
     /* We need to call CheckMotion for each event. It doesn't really give us
-       any benefit for relative devices, but absolute devices won't send
-       button events to the right position. 
-     */
+       any benefit for relative devices, but absolute devices may not send
+       button events to the right position otherwise. */
     if (!CheckMotion(xE, mouse) && xE->u.u.type == MotionNotify)
             return;
     if (xE->u.u.type != MotionNotify)
diff-tree 62efc3951a96648cf975302aa6651cb67b87fa64 (from 3312e4dd5e055b2cb445b5d5c617aa7a611eedc1)
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Fri Jul 6 17:00:20 2007 +0930

    DeliverGrabbedEvent: stop segfault when gemask == NULL.

diff --git a/dix/events.c b/dix/events.c
index 9a6ab33..8fcbec7 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -3283,7 +3283,7 @@ DeliverGrabbedEvent(xEvent *xE, DeviceIn
                 xGenericEvent* ge = ((xGenericEvent*)xE);
                 GenericMaskPtr    gemask = grab->genericMasks;
 
-                if (!gemask->eventMask[GEEXTIDX(ge)])
+                if (!gemask || !gemask->eventMask[GEEXTIDX(ge)])
                     return;
 
                 if (GEEventFill(xE))
diff-tree 3312e4dd5e055b2cb445b5d5c617aa7a611eedc1 (from c1a6841a64576b7e688e9ca0d3e0db8acf52d4ae)
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Fri Jul 6 16:41:52 2007 +0930

    Call CheckMotion for all core events.
    
    We need to do this to update the sprites x/y coordinate before we assemble a
    button event. Absolute devices may send a buttonEvent with valuators attached.
    If we don't update the sprite before assembling the event, the valuators are
    lost and the button press is delivered to the previous position of the device.
    Doesn't have any effect on relative devices.

diff --git a/dix/events.c b/dix/events.c
index 1bec4fc..9a6ab33 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -3634,6 +3634,12 @@ ProcessPointerEvent (xEvent *xE, DeviceI
 	    CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo);
 	}
     }
+    /* We need to call CheckMotion for each event. It doesn't really give us
+       any benefit for relative devices, but absolute devices won't send
+       button events to the right position. 
+     */
+    if (!CheckMotion(xE, mouse) && xE->u.u.type == MotionNotify)
+            return;
     if (xE->u.u.type != MotionNotify)
     {
 	int  key;
@@ -3682,8 +3688,7 @@ ProcessPointerEvent (xEvent *xE, DeviceI
 	    FatalError("bogus pointer event from ddx");
 	}
     }
-    else if (!CheckMotion(xE, mouse))
-	return;
+
     if (grab)
 	DeliverGrabbedEvent(xE, mouse, deactivateGrab, count);
     else
diff-tree c1a6841a64576b7e688e9ca0d3e0db8acf52d4ae (from 5ccc09b18244f91a06b3bea20b02a97280d1a229)
Author: Paulo Ricardo Zanoni <prz05 at c3sl.ufpr.br>
Date:   Tue Jul 10 10:08:44 2007 +0930

    ProcX{Change|Query}WindowAccess: change device list from char* to XID*.

diff --git a/Xi/chaccess.c b/Xi/chaccess.c
index 5005e94..f099206 100644
--- a/Xi/chaccess.c
+++ b/Xi/chaccess.c
@@ -65,7 +65,7 @@ int 
 ProcXChangeWindowAccess(ClientPtr client)
 {
     int padding, err, i;
-    CARD8* deviceids = NULL;
+    XID* deviceids = NULL;
     WindowPtr win;
     DeviceIntPtr* perm_devices = NULL;
     DeviceIntPtr* deny_devices = NULL;
@@ -73,10 +73,10 @@ ProcXChangeWindowAccess(ClientPtr client
     REQUEST_AT_LEAST_SIZE(xChangeWindowAccessReq);
     
 
-    padding = (4 - ((stuff->npermit + stuff->ndeny) % 4)) % 4;
+    padding = (4 - (((stuff->npermit + stuff->ndeny) * sizeof(XID)) % 4)) % 4;
 
     if (stuff->length != ((sizeof(xChangeWindowAccessReq)  + 
-            (stuff->npermit + stuff->ndeny + padding)) >> 2))
+            (((stuff->npermit + stuff->ndeny) * sizeof(XID)) + padding)) >> 2))
     {
         SendErrorToClient(client, IReqCode, X_ChangeWindowAccess, 
                 0, BadLength);
@@ -102,7 +102,7 @@ ProcXChangeWindowAccess(ClientPtr client
     }
 
     if (stuff->npermit || stuff->ndeny)
-        deviceids = (CARD8*)&stuff[1];
+        deviceids = (XID*)&stuff[1];
 
     if (stuff->npermit)
     {
diff --git a/Xi/qryacces.c b/Xi/qryacces.c
index 817bec8..b596969 100644
--- a/Xi/qryacces.c
+++ b/Xi/qryacces.c
@@ -69,7 +69,7 @@ ProcXQueryWindowAccess(ClientPtr client)
     DeviceIntPtr *perm, *deny;
     int nperm, ndeny, i;
     int defaultRule;
-    CARD8* deviceids;
+    XID* deviceids;
     xQueryWindowAccessReply rep;
 
     REQUEST(xQueryWindowAccessReq);
@@ -88,7 +88,7 @@ ProcXQueryWindowAccess(ClientPtr client)
     rep.repType = X_Reply;
     rep.RepType = X_QueryWindowAccess;
     rep.sequenceNumber = client->sequence;
-    rep.length = (nperm + ndeny + 3) >> 2;
+    rep.length = ((nperm + ndeny) * sizeof(XID) + 3) >> 2;
     rep.defaultRule = defaultRule;
     rep.npermit = nperm;
     rep.ndeny = ndeny;
@@ -96,7 +96,7 @@ ProcXQueryWindowAccess(ClientPtr client)
 
     if (nperm + ndeny)
     {
-        deviceids = (CARD8*)xalloc((nperm + ndeny) * sizeof(CARD8));
+        deviceids = (XID*)xalloc((nperm + ndeny) * sizeof(XID));
         if (!deviceids)
         {
             ErrorF("ProcXQueryWindowAccess: xalloc failure.\n");
@@ -110,7 +110,7 @@ ProcXQueryWindowAccess(ClientPtr client)
         for (i = 0; i < ndeny; i++)
             deviceids[i + nperm] = deny[i]->id;
 
-        WriteToClient(client, nperm + ndeny, (char*)deviceids);
+        WriteToClient(client, (nperm + ndeny) * sizeof(XID), (char*)deviceids);
         xfree(deviceids);
     }
     return Success;
diff-tree 5ccc09b18244f91a06b3bea20b02a97280d1a229 (from c1a16bdcfe7aa907fe78f27dc606a8e5a2699952)
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Fri Jul 6 15:43:08 2007 +0930

    Use the same struct for generic event masks throughout the code.
    Renaming those structs too.
    
    Previously grabs were using a different struct than windows, which was
    reasonably stupid.

diff --git a/Xext/geext.c b/Xext/geext.c
index 0add5e1..0c5fcab 100644
--- a/Xext/geext.c
+++ b/Xext/geext.c
@@ -207,7 +207,7 @@ GEExtensionInit(void)
 
     GEClientPrivateIndex = AllocateClientPrivateIndex(); 
     if (!AllocateClientPrivate(GEClientPrivateIndex, 
-                               sizeof(GEClientRec)))
+                               sizeof(GenericMaskRec)))
     {
         FatalError("GEExtensionInit: Alloc client private failed.\n");
     }
@@ -277,8 +277,8 @@ static void 
 GERecalculateWinMask(WindowPtr pWin)
 {
     int i;
-    GEClientPtr it;
-    GEEventMasksPtr evmasks;
+    GenericMaskPtr it;
+    GenericClientMasksPtr evmasks;
 
     if (!pWin->optional)
         return;
@@ -304,7 +304,7 @@ GERecalculateWinMask(WindowPtr pWin)
 /* Set generic event mask for given window. */
 void GEWindowSetMask(ClientPtr pClient, WindowPtr pWin, int extension, Mask mask)
 {
-    GEClientPtr cli;
+    GenericMaskPtr cli;
 
     extension = (extension & 0x7F);
 
@@ -322,7 +322,7 @@ void GEWindowSetMask(ClientPtr pClient, 
 
     if (mask)
     {
-        GEEventMasksPtr evmasks = pWin->optional->geMasks;
+        GenericClientMasksPtr evmasks = pWin->optional->geMasks;
 
         /* check for existing client */
         cli = evmasks->geClients;
@@ -335,7 +335,7 @@ void GEWindowSetMask(ClientPtr pClient, 
         if (!cli)
         {
             /* new client */
-            cli  = (GEClientPtr)xcalloc(1, sizeof(GEClientRec));
+            cli  = (GenericMaskPtr)xcalloc(1, sizeof(GenericMaskRec));
             if (!cli)
             {
                 ErrorF("GE: Insufficient memory to alloc client.\n");
@@ -356,7 +356,7 @@ void GEWindowSetMask(ClientPtr pClient, 
             xfree(cli);
         } else 
         { 
-            GEClientPtr prev = cli;
+            GenericMaskPtr prev = cli;
             cli = cli->next;
 
             while(cli)
diff --git a/Xext/geext.h b/Xext/geext.h
index bac4726..f3352c2 100644
--- a/Xext/geext.h
+++ b/Xext/geext.h
@@ -34,6 +34,21 @@ from the author.
 #define _GEEXT_H_
 #include <X11/extensions/geproto.h>
 
+
+/**
+ * This struct is used both in the window and by grabs to determine the event
+ * mask for a client.
+ * A window will have a linked list of these structs, with one entry per
+ * client, null-terminated.
+ * A grab has only one instance of this struct.
+ */
+typedef struct _GenericMaskRec {
+    ClientPtr   client;                   /* client who set the event mask */
+    Mask        eventMask[MAXEXTENSIONS]; /* one mask per extension */
+    struct _GenericMaskRec* next;            
+} GenericMaskRec, *GenericMaskPtr;
+
+
 /* Struct to keep information about registered extensions
  *
  * evswap ... use to swap event fields for different byte ordered clients.
@@ -48,6 +63,7 @@ typedef struct _GEExtension {
                     );
 } GEExtension, *GEExtensionPtr;
 
+
 /* All registered extensions and their handling functions. */
 extern GEExtension GEExtensions[MAXEXTENSIONS];
 
diff --git a/Xi/extgrbdev.c b/Xi/extgrbdev.c
index 8ae2053..c4011f5 100644
--- a/Xi/extgrbdev.c
+++ b/Xi/extgrbdev.c
@@ -194,19 +194,13 @@ ProcXExtendedGrabDevice(ClientPtr client
             (XGenericEventMask*)(((XEventClass*)&stuff[1]) + stuff->event_count);
 
         gemasks = xcalloc(1, sizeof(GenericMaskRec));
-        gemasks->extension = xgeMask->extension;
-        gemasks->mask = xgeMask->evmask;
+        gemasks->client = client;
         gemasks->next = NULL;
-        xgeMask++;
+        gemasks->eventMask[xgeMask->extension & 0x7F] = xgeMask->evmask;
 
+        xgeMask++;
         for (i = 1; i < stuff->generic_event_count; i++, xgeMask++)
-        {
-            gemasks->next = xcalloc(1, sizeof(GenericMaskRec));
-            gemasks = gemasks->next;
-            gemasks->extension = xgeMask->extension;
-            gemasks->mask = xgeMask->evmask;
-            gemasks->next = NULL;
-        }
+            gemasks->eventMask[xgeMask->extension & 0x7F]= xgeMask->evmask;
     }
 
     ExtGrabDevice(client, dev, stuff->device_mode, 
@@ -221,12 +215,8 @@ ProcXExtendedGrabDevice(ClientPtr client
     
 cleanup:
 
-    while(gemasks)
-    {
-        GenericMaskPtr prev = gemasks;
-        gemasks = gemasks->next;
-        xfree(prev);
-    }
+    if (gemasks)
+        xfree(gemasks);
 
     if (err == Success)
     {
diff --git a/dix/events.c b/dix/events.c
index d4af307..1bec4fc 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1934,7 +1934,7 @@ DeliverEventsToWindow(DeviceIntPtr pDev,
         /* Handle generic events */
         if (type == GenericEvent)
         {
-            GEClientPtr pClient;
+            GenericMaskPtr pClient;
             /* We don't do more than one GenericEvent at a time. */
             if (count > 1)
             {
@@ -2017,7 +2017,24 @@ DeliverEventsToWindow(DeviceIntPtr pDev,
         inputMasks = wOtherInputMasks(pWin);
         tempGrab.deviceMask = (inputMasks) ? inputMasks->inputEvents[pDev->id]: 0;
 
-        tempGrab.genericMasks = NULL;
+        /* get the XGE event mask. 
+         * FIXME: needs to be freed somewhere too.
+         */
+        if (!pWin->optional || !pWin->optional->geMasks)
+            tempGrab.genericMasks = NULL;
+        else
+        {
+            GenericClientMasksPtr gemasks = pWin->optional->geMasks;
+            GenericMaskPtr geclient = gemasks->geClients;
+            while(geclient && geclient->client != client)
+                geclient = geclient->next;
+            if (geclient)
+            {
+                tempGrab.genericMasks = xcalloc(1, sizeof(GenericMaskRec));
+                *tempGrab.genericMasks = *geclient;
+                tempGrab.genericMasks->next = NULL;
+            }
+        }
 	(*inputInfo.pointer->deviceGrab.ActivateGrab)(pDev, &tempGrab,
 					   currentTime, 
                                            TRUE | ImplicitGrabMask);
@@ -3264,21 +3281,15 @@ DeliverGrabbedEvent(xEvent *xE, DeviceIn
             {
                 /* find evmask for event's extension */
                 xGenericEvent* ge = ((xGenericEvent*)xE);
-                GenericMaskPtr gemask = grab->genericMasks;
-                while(gemask)
-                {
-                    if (gemask->extension == ge->extension)
-                        break;
-                    gemask = gemask->next;
-                }
+                GenericMaskPtr    gemask = grab->genericMasks;
 
-                if (!gemask)
+                if (!gemask->eventMask[GEEXTIDX(ge)])
                     return;
 
                 if (GEEventFill(xE))
                     GEEventFill(xE)(ge, thisDev, grab->window, grab);
                 deliveries = TryClientEvents(rClient(grab), xE, count, 
-                        gemask->mask,
+                        gemask->eventMask[GEEXTIDX(ge)],
                         generic_filters[GEEXTIDX(ge)][ge->evtype],
                         grab);
             } else 
@@ -4161,7 +4172,6 @@ FocusEvent(DeviceIntPtr dev, int type, i
     xEvent event;
     int* numFoci; /* no of foci the window has already */
     Bool sendevent = FALSE;
-    FocusSemaphoresPtr focus;
 
     if (dev != inputInfo.keyboard)
 	DeviceFocusEvent(dev, type, mode, detail, pWin);
@@ -5914,21 +5924,9 @@ ExtGrabDevice(ClientPtr client, 
 
     if (ge_masks)
     {
-        GenericMaskPtr last;
         newGrab.genericMasks  = xcalloc(1, sizeof(GenericMaskRec));
         *newGrab.genericMasks = *ge_masks;
         newGrab.genericMasks->next = NULL;
-        ge_masks = ge_masks->next;
-        last     = newGrab.genericMasks;
-
-        while(ge_masks)
-        {
-            last->next = xcalloc(1, sizeof(GenericMaskRec));
-            last = last->next;
-            *last = *ge_masks;
-            last->next = NULL;
-            ge_masks = ge_masks->next;
-        }
     }
 
     if (IsPointerDevice(dev))
diff --git a/dix/window.c b/dix/window.c
index b49abdf..193f1aa 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -3751,7 +3751,8 @@ MakeWindowOptional (WindowPtr pWin)
 #endif
     optional->deviceCursors = NULL;
 
-    optional->geMasks = (GEEventMasksPtr)xalloc(sizeof(GEEventMasksRec));
+    optional->geMasks = 
+        (GenericClientMasksPtr)xalloc(sizeof(GenericClientMasksRec));
     if (!optional->geMasks)
     {
         xfree(optional);
diff --git a/include/dix.h b/include/dix.h
index be1cb95..2fc6254 100644
--- a/include/dix.h
+++ b/include/dix.h
@@ -52,6 +52,7 @@ SOFTWARE.
 #include "window.h"
 #include "input.h"
 #include "cursor.h"
+#include "geext.h"
 #include <X11/extensions/XI.h>
 
 #define EARLIER -1
diff --git a/include/inputstr.h b/include/inputstr.h
index d9128cc..6c65aa4 100644
--- a/include/inputstr.h
+++ b/include/inputstr.h
@@ -53,6 +53,7 @@ SOFTWARE.
 #include "window.h"
 #include "dixstruct.h"
 #include "cursorstr.h"
+#include "geext.h"
 
 #define BitIsOn(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7)))
 
@@ -102,12 +103,6 @@ typedef struct _DetailRec {		/* Grab det
     Mask                *pMask;
 } DetailRec;
 
-typedef struct _GenericMaskRec {
-    int                 extension;
-    Mask                mask;
-    struct _GenericMaskRec* next;
-} GenericMaskRec;
-
 /**
  * Central struct for device grabs. 
  * The same struct is used for both core grabs and device grabs, with
@@ -139,7 +134,7 @@ typedef struct _GrabRec {
     CursorPtr		cursor;		/* always NULL for keyboards */
     Mask		eventMask;
     Mask                deviceMask;     
-    GenericMaskPtr      genericMasks;   /* null terminated list */
+    GenericMaskPtr      genericMasks;
 } GrabRec;
 
 typedef struct _KeyClassRec {
diff --git a/include/misc.h b/include/misc.h
index 14c848d..e6a5e9e 100644
--- a/include/misc.h
+++ b/include/misc.h
@@ -243,7 +243,6 @@ typedef struct pixman_box16 *BoxPtr;
 typedef struct _xEvent *xEventPtr;
 typedef struct _xRectangle *xRectanglePtr;
 typedef struct _GrabRec *GrabPtr;
-typedef struct _GenericMaskRec *GenericMaskPtr;
 
 /*  typedefs from other places - duplicated here to minimize the amount
  *  of unnecessary junk that one would normally have to include to get
diff --git a/include/windowstr.h b/include/windowstr.h
index a1d501d..959ea0e 100644
--- a/include/windowstr.h
+++ b/include/windowstr.h
@@ -77,17 +77,15 @@ typedef struct _DevCursorNode {
     struct _DevCursorNode*      next;
 } DevCursNodeRec, *DevCursNodePtr, *DevCursorList;
 
-typedef struct _GEClientRec {
-    Mask        eventMask[MAXEXTENSIONS];
-    ClientPtr   client;
-    struct _GEClientRec* next;
-} GEClientRec, *GEClientPtr;
-
-/* Mask structure for GE extension. Allows one mask per extension. */
-typedef struct _GEEventMasks {
-    Mask        eventMasks[MAXEXTENSIONS];
-    struct _GEClientRec*  geClients;
-} GEEventMasksRec, *GEEventMasksPtr;
+/* Mask structure for GE extension as stored on the window.
+ * Allows one mask per extension.
+ *   .eventMask - Summary mask for all clients, used for quick checking.
+ *   .geClients - list of clients with their specific mask.
+ */
+typedef struct _GenericClientMasks {
+    Mask                eventMasks[MAXEXTENSIONS];
+    GenericMaskPtr      geClients;
+} GenericClientMasksRec, *GenericClientMasksPtr;
 
 typedef struct _WindowAccessRec {
     int                  defaultRule;      /* WindowAccessDenyAll */
@@ -117,7 +115,7 @@ typedef struct _WindowOpt {
     struct _OtherInputMasks *inputMasks;   /* default: NULL */
 #endif
     DevCursorList       deviceCursors;     /* default: NULL */
-    struct _GEEventMasks* geMasks;         /* default: NULL */
+    struct _GenericClientMasks *geMasks;/* default: NULL */
     WindowAccessRec     access;
 } WindowOptRec, *WindowOptPtr;
 


More information about the xorg-commit mailing list