xserver: Branch 'mpx' - 9 commits

Peter Hutterer whot at kemper.freedesktop.org
Sun Feb 17 22:48:30 PST 2008


 Xi/Makefile.am   |    4 -
 Xi/chdevhier.c   |   68 +++++++++++++++++++-----------
 Xi/extinit.c     |   34 ---------------
 Xi/fakedevdata.c |  123 -------------------------------------------------------
 Xi/fakedevdata.h |   42 ------------------
 Xi/grabacc.c     |  102 ---------------------------------------------
 Xi/grabacc.h     |   41 ------------------
 Xi/querydp.c     |    1 
 dix/getevents.c  |   39 +----------------
 dix/window.c     |    8 +++
 mi/mieq.c        |    6 --
 11 files changed, 56 insertions(+), 412 deletions(-)

New commits:
commit 088067c891a78670d9509f48f56bf3ff9c16a30d
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Mon Feb 18 16:46:07 2008 +1030

    Xi: even if ChangeDeviceHierarchy fails, we may need to send an event.
    
    Changes are committed instantly, so if at least one change was successful, we
    must send an event to the client, even if subsequent ones fail.

diff --git a/Xi/chdevhier.c b/Xi/chdevhier.c
index b749567..e9a5076 100644
--- a/Xi/chdevhier.c
+++ b/Xi/chdevhier.c
@@ -84,6 +84,7 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
     int required_len = sizeof(xChangeDeviceHierarchyReq);
     char n;
     int rc;
+    int nchanges = 0;
     deviceHierarchyChangedEvent ev;
 
     REQUEST(xChangeDeviceHierarchyReq);
@@ -115,7 +116,7 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
                     if (rc != Success)
                     {
                         xfree(name);
-                        return rc;
+                        goto unwind;
                     }
 
                     if (!c->sendCore)
@@ -130,6 +131,7 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
                         EnableDevice(keybd);
                     }
                     xfree(name);
+                    nchanges++;
                 }
                 break;
             case CH_RemoveMasterDevice:
@@ -143,18 +145,22 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
                     rc = dixLookupDevice(&ptr, r->deviceid, client,
                                          DixDestroyAccess);
                     if (rc != Success)
-                        return rc;
+                        goto unwind;
 
                     if (!ptr->isMaster)
                     {
                         client->errorValue = r->deviceid;
-                        return BadDevice;
+                        rc = BadDevice;
+                        goto unwind;
                     }
 
                     /* XXX: For now, don't allow removal of VCP, VCK */
                     if (ptr == inputInfo.pointer ||
                             ptr == inputInfo.keyboard)
-                        return BadDevice;
+                    {
+                        rc = BadDevice;
+                        goto unwind;
+                    }
 
                     /* disable keyboards first */
                     if (IsPointerDevice(ptr))
@@ -164,7 +170,7 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
                                              client,
                                              DixDestroyAccess);
                         if (rc != Success)
-                            return rc;
+                            goto unwind;
                     }
                     else
                     {
@@ -174,7 +180,7 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
                                              client,
                                              DixDestroyAccess);
                         if (rc != Success)
-                            return rc;
+                            goto unwind;
                     }
 
 
@@ -189,23 +195,25 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
                         rc = dixLookupDevice(&newptr, r->returnPointer,
                                              client, DixWriteAccess);
                         if (rc != Success)
-                            return rc;
+                            goto unwind;
 
                         if (!newptr->isMaster)
                         {
                             client->errorValue = r->returnPointer;
-                            return BadDevice;
+                            rc = BadDevice;
+                            goto unwind;
                         }
 
                         rc = dixLookupDevice(&newkeybd, r->returnKeyboard,
                                              client, DixWriteAccess);
                         if (rc != Success)
-                            return rc;
+                            goto unwind;
 
                         if (!newkeybd->isMaster)
                         {
                             client->errorValue = r->returnKeyboard;
-                            return BadDevice;
+                            rc = BadDevice;
+                            goto unwind;
                         }
 
                         for (attached = inputInfo.devices;
@@ -229,6 +237,7 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
 
                     RemoveDevice(keybd);
                     RemoveDevice(ptr);
+                    nchanges++;
                 }
                 break;
             case CH_ChangeAttachment:
@@ -238,12 +247,13 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
                     rc = dixLookupDevice(&ptr, c->deviceid, client,
                                           DixWriteAccess);
                     if (rc != Success)
-                        return rc;
+                       goto unwind;
 
                     if (ptr->isMaster)
                     {
                         client->errorValue = c->deviceid;
-                        return BadDevice;
+                        rc = BadDevice;
+                        goto unwind;
                     }
 
                     if (c->changeMode == Floating)
@@ -254,21 +264,25 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
                         rc = dixLookupDevice(&newmaster, c->newMaster,
                                              client, DixWriteAccess);
                         if (rc != Success)
-                            return rc;
+                            goto unwind;
                         if (!newmaster->isMaster)
                         {
                             client->errorValue = c->newMaster;
-                            return BadDevice;
+                            rc = BadDevice;
+                            goto unwind;
                         }
 
                         if ((IsPointerDevice(newmaster) &&
                                     !IsPointerDevice(ptr)) ||
                                 (IsKeyboardDevice(newmaster) &&
                                  !IsKeyboardDevice(ptr)))
-                                return BadDevice;
+                        {
+                            rc = BadDevice;
+                            goto unwind;
+                        }
                         AttachDevice(client, ptr, newmaster);
                     }
-
+                    nchanges++;
                 }
                 break;
         }
@@ -276,14 +290,20 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
         any = (xAnyHierarchyChangeInfo*)((char*)any + any->length);
     }
 
-    ev.type = GenericEvent;
-    ev.extension = IReqCode;
-    ev.length = 0;
-    ev.evtype = XI_DeviceHierarchyChangedNotify;
-    ev.time = GetTimeInMillis();
+unwind:
 
-    SendEventToAllWindows(&dummyDev, XI_DeviceHierarchyChangedMask,
-            (xEvent*)&ev, 1);
-    return Success;
+    if (nchanges > 0) /* even if an error occured, we need to send an event if
+                       we changed anything in the hierarchy. */
+    {
+        ev.type = GenericEvent;
+        ev.extension = IReqCode;
+        ev.length = 0;
+        ev.evtype = XI_DeviceHierarchyChangedNotify;
+        ev.time = GetTimeInMillis();
+
+        SendEventToAllWindows(&dummyDev, XI_DeviceHierarchyChangedMask,
+                (xEvent*)&ev, 1);
+    }
+    return rc;
 }
 
commit 660739c6bc84cb74f43a277052ce163fae654417
Author: Benjamin Close <Benjamin.Close at clearchain.com>
Date:   Fri Feb 15 13:36:34 2008 +1030

    dix: Handle the case where a device cursor was removed correctly
    
    In the case that the device cursor was the first in the list of cursors
    the window knew about, unsetting the cursor could lead to a segfault
    due to pPrev being NULL. Instead catch the condition and correctly remove
    the node from the list. Since there is no cursor now set on the device,
    we simply return success as the parent windows cursor will propogate
    down later.
    
    Signed-off-by: Peter Hutterer <peter at cs.unisa.edu.au>

diff --git a/dix/window.c b/dix/window.c
index 3b69e45..a941dac 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -3823,8 +3823,14 @@ ChangeWindowDeviceCursor(WindowPtr pWin,
 
         if (!pCursor) /* remove from list */
         {
-            pPrev->next = pNode->next;
+                if(pPrev)
+                    pPrev->next = pNode->next;
+                else
+                    /* first item in list */
+                    pWin->optional->deviceCursors = pNode->next;
+
             xfree(pNode);
+            return Success;
         }
 
     } else
commit 24db28230120ecc2b65b25164b6e7b407970f9e2
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Mon Feb 18 16:16:19 2008 +1030

    dix: set num_events to 1 by default. (no RawDeviceEvents anymore)
    
    This should have been part of acb412d5399f865b5048fdd683147cea0f19f0c1.

diff --git a/dix/getevents.c b/dix/getevents.c
index ee58f02..1f8f0e0 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -657,7 +657,7 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons,
 
     ms = GetTimeInMillis();
 
-    num_events = 2;
+    num_events = 1;
 
     master = pDev->u.master;
     if (master && master->u.lastSlave != pDev)
commit 921c298c4cdd2c879403ebdacbef48129058cad4
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Thu Feb 14 09:48:19 2008 +1030

    Xi: QueryDevicePointer doesn't have a shared field anymore.

diff --git a/Xi/querydp.c b/Xi/querydp.c
index 629d8ef..3103346 100644
--- a/Xi/querydp.c
+++ b/Xi/querydp.c
@@ -113,7 +113,6 @@ ProcXQueryDevicePointer(ClientPtr client)
     rep.rootX = pSprite->hot.x;
     rep.rootY = pSprite->hot.y;
     rep.child = None;
-    rep.shared = (pDev->spriteInfo->spriteOwner) ? xFalse : xTrue;
 
     if (pSprite->hot.pScreen == pWin->drawable.pScreen)
     {
commit b885588756450e2fa25fdd191e300e1c5dd37ec3
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Thu Feb 14 09:47:31 2008 +1030

    Xi: remove FakeDeviceData calls. And one leftover from GrabAccessControl.
    
    FakeDeviceData needs more thoughtful integration.

diff --git a/Xi/Makefile.am b/Xi/Makefile.am
index 0406638..7804c51 100644
--- a/Xi/Makefile.am
+++ b/Xi/Makefile.am
@@ -32,8 +32,6 @@ libXi_la_SOURCES =	\
         extgrbdev.c \
         extgrbdev.h \
 	extinit.c \
-	fakedevdata.c \
-	fakedevdata.h \
 	getbmap.c \
 	getbmap.h \
 	getcptr.c \
diff --git a/Xi/extinit.c b/Xi/extinit.c
index f8c9927..0cf429f 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -86,7 +86,6 @@ SOFTWARE.
 #include "closedev.h"
 #include "extgrbdev.h"
 #include "devbell.h"
-#include "fakedevdata.h"
 #include "getbmap.h"
 #include "getbmap.h"
 #include "getcptr.h"
@@ -338,8 +337,6 @@ ProcIDispatch(ClientPtr client)
         return ProcXGetClientPointer(client);
     else if (stuff->data == X_GetPairedPointer)
         return ProcXGetPairedPointer(client);
-    else if (stuff->data == X_FakeDeviceData)
-        return ProcXFakeDeviceData(client);
     else if (stuff->data == X_ExtendedGrabDevice)
         return ProcXExtendedGrabDevice(client);
     else {
@@ -451,8 +448,6 @@ SProcIDispatch(ClientPtr client)
         return SProcXGetClientPointer(client);
     else if (stuff->data == X_GetPairedPointer)
         return SProcXGetPairedPointer(client);
-    else if (stuff->data == X_FakeDeviceData)
-        return SProcXFakeDeviceData(client);
     else if (stuff->data == X_ExtendedGrabDevice)
         return SProcXExtendedGrabDevice(client);
     else {
@@ -530,9 +525,6 @@ SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep)
     else if (rep->RepType == X_QueryDevicePointer)
 	SRepXQueryDevicePointer(client, len,
 				(xQueryDevicePointerReply *) rep);
-    else if (rep->RepType == X_GrabAccessControl)
-        SRepXGrabAccessControl(client, len,
-                                  (xGrabAccessControlReply*) rep);
     else if (rep->RepType == X_QueryWindowAccess)
         SRepXQueryWindowAccess(client, len,
                                (xQueryWindowAccessReply*) rep);
diff --git a/Xi/fakedevdata.c b/Xi/fakedevdata.c
deleted file mode 100644
index 92ee8ee..0000000
--- a/Xi/fakedevdata.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
-
-Copyright 2007 Peter Hutterer <peter at cs.unisa.edu.au>
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the author shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from the author.
-
-*/
-
-/***********************************************************************
- *
- * Request to fake data for a given device.
- *
- */
-
-#define	 NEED_EVENTS
-#define	 NEED_REPLIES
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include <X11/X.h>	/* for inputstr.h    */
-#include <X11/Xproto.h>	/* Request macro     */
-#include "inputstr.h"	/* DeviceIntPtr      */
-#include "windowstr.h"	/* window structure  */
-#include "scrnintstr.h"	/* screen structure  */
-#include <X11/extensions/XI.h>
-#include <X11/extensions/XIproto.h>
-#include "extnsionst.h"
-#include "exevents.h"
-#include "exglobals.h"
-#include "mi.h"
-
-#include "fakedevdata.h"
-
-static EventListPtr fake_events = NULL;
-
-int
-SProcXFakeDeviceData(ClientPtr client)
-{
-    char n;
-    int i;
-    ValuatorData* p;
-
-    REQUEST(xFakeDeviceDataReq);
-
-    swaps(&stuff->length, n);
-    REQUEST_AT_LEAST_SIZE(xFakeDeviceDataReq);
-
-    p = (ValuatorData*)&stuff[1];
-    for (i = 0; i <  stuff->num_valuators; i++, p++)
-        swapl(p, n);
-
-    return ProcXFakeDeviceData(client);;
-}
-
-int
-ProcXFakeDeviceData(ClientPtr client)
-{
-    DeviceIntPtr dev;
-    int nevents, i;
-    int* valuators = NULL;
-    int rc;
-
-    REQUEST(xFakeDeviceDataReq);
-    REQUEST_AT_LEAST_SIZE(xFakeDeviceDataReq);
-
-    if (stuff->length != (sizeof(xFakeDeviceDataReq) >> 2) + stuff->num_valuators)
-    {
-        return BadLength;
-    }
-
-    rc = dixLookupDevice(&dev, stuff->deviceid, client, DixWriteAccess);
-    if (rc != Success)
-        return rc;
-
-    if (!fake_events && !(fake_events = InitEventList(GetMaximumEventsNum())))
-    {
-        return BadAlloc;
-    }
-    if (stuff->num_valuators)
-    {
-        CARD32* valptr = (CARD32*)&stuff[1];
-
-        valuators = xcalloc(stuff->num_valuators, sizeof(int));
-        if (!valuators)
-        {
-            return BadAlloc;
-        }
-        for (i = 0; i < stuff->num_valuators; i++, valptr++)
-            valuators[i] = (int)(*valptr);
-    }
-
-    nevents = GetPointerEvents(fake_events, dev, stuff->type, stuff->buttons,
-            POINTER_RELATIVE, stuff->first_valuator, stuff->num_valuators,
-            valuators);
-
-    OsBlockSignals();
-    for (i = 0; i < nevents; i++)
-        mieqEnqueue(dev, (fake_events+ i)->event);
-    OsReleaseSignals();
-    xfree(valuators);
-    return Success;
-}
diff --git a/Xi/fakedevdata.h b/Xi/fakedevdata.h
deleted file mode 100644
index 28dd729..0000000
--- a/Xi/fakedevdata.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
-
-Copyright 2007 Peter Hutterer <peter at cs.unisa.edu.au>
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the author shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from the author.
-
-*/
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#ifndef FAKEDEVDATA_H
-#define FAKEDEVDATA_H 1
-
-int SProcXFakeDeviceData(ClientPtr	/* client */
-    );
-
-int ProcXFakeDeviceData(ClientPtr	/* client */
-    );
-
-#endif /* FAKEDEVDATA_H */
commit c99a9a97290c51bf2843f42d5683888cea8a3ff6
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Thu Feb 14 09:43:49 2008 +1030

    Xi: remove raw device events.
    
    Need to be better refined.

diff --git a/Xi/extinit.c b/Xi/extinit.c
index 9c42a5d..f8c9927 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -138,7 +138,6 @@ Mask ExtExclusiveMasks[EMASKSIZE];
 static Mask xi_filters[4] = {
     XI_DeviceHierarchyChangedMask,
     XI_DeviceClassesChangedMask,
-    XI_RawDeviceEventMask,
 };
 
 static struct dev_type
@@ -676,23 +675,6 @@ SDeviceLeaveNotifyEvent (deviceLeaveNotify *from, deviceLeaveNotify *to)
 }
 
 static void
-SRawDeviceEvent(rawDeviceEvent* from, rawDeviceEvent *to)
-{
-    char n;
-    int i;
-    CARD32* valptr;
-   
-
-    *to = *from;
-    swaps(&to->sequenceNumber, n);
-    swapl(&to->length, n);
-    swapl(&to->evtype, n);
-    valptr = &to->valuator0;
-    for (i = 0; i < from->num_valuators; i++, valptr++)
-        swapl(valptr, n);
-}
-
-static void
 SDeviceClassesChangedEvent(deviceClassesChangedEvent* from,
                            deviceClassesChangedEvent* to)
 {
@@ -1169,9 +1151,6 @@ XIGEEventSwap(xGenericEvent* from, xGenericEvent* to)
     swaps(&from->sequenceNumber, n);
     switch(from->evtype)
     {
-        case XI_RawDeviceEvent:
-            SRawDeviceEvent((rawDeviceEvent*)from, (rawDeviceEvent*)to);
-            break;
         case XI_DeviceClassesChangedNotify:
             SDeviceClassesChangedEvent((deviceClassesChangedEvent*)from,
                                        (deviceClassesChangedEvent*)to);
commit b35a9efa16d9e14378a95c11fa39171b78710996
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Thu Feb 14 09:41:49 2008 +1030

    Xi: Remove files for GrabAccessControl.

diff --git a/Xi/Makefile.am b/Xi/Makefile.am
index 9c5658d..0406638 100644
--- a/Xi/Makefile.am
+++ b/Xi/Makefile.am
@@ -56,8 +56,6 @@ libXi_la_SOURCES =	\
 	getselev.h \
 	getvers.c \
 	getvers.h \
-        grabacc.c \
-        grabacc.h \
 	grabdev.c \
 	grabdev.h \
 	grabdevb.c \
diff --git a/Xi/extinit.c b/Xi/extinit.c
index 6aa1ece..9c42a5d 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -100,7 +100,6 @@ SOFTWARE.
 #include "getselev.h"
 #include "getvers.h"
 #include "getvers.h"
-#include "grabacc.h"
 #include "grabdev.h"
 #include "grabdevb.h"
 #include "grabdevk.h"
@@ -330,8 +329,6 @@ ProcIDispatch(ClientPtr client)
         return (ProcXChangeDeviceHierarchy(client));
     else if (stuff->data == X_XiSelectEvent)
         return (ProcXiSelectEvent(client));
-    else if (stuff->data == X_GrabAccessControl)
-        return (ProcXGrabAccessControl(client));
     else if (stuff->data == X_ChangeWindowAccess)
         return (ProcXChangeWindowAccess(client));
     else if (stuff->data == X_QueryWindowAccess)
@@ -445,8 +442,6 @@ SProcIDispatch(ClientPtr client)
         return (SProcXChangeDeviceHierarchy(client));
     else if (stuff->data == X_XiSelectEvent)
         return (SProcXiSelectEvent(client));
-    else if (stuff->data == X_GrabAccessControl)
-        return (SProcXGrabAccessControl(client));
     else if (stuff->data == X_ChangeWindowAccess)
         return (SProcXChangeWindowAccess(client));
     else if (stuff->data == X_QueryWindowAccess)
diff --git a/Xi/grabacc.c b/Xi/grabacc.c
deleted file mode 100644
index 83b8736..0000000
--- a/Xi/grabacc.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
-
-Copyright 2007 Peter Hutterer <peter at cs.unisa.edu.au>
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the author shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from the author.
-
-*/
-
-#define	 NEED_EVENTS
-#define	 NEED_REPLIES
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include <X11/X.h>	/* for inputstr.h    */
-#include <X11/Xproto.h>	/* Request macro     */
-#include "inputstr.h"	/* DeviceIntPtr      */
-#include "windowstr.h"	/* window structure  */
-#include "scrnintstr.h"	/* screen structure  */
-#include <X11/extensions/XI.h>
-#include <X11/extensions/XIproto.h>
-#include "extnsionst.h"
-#include "extinit.h"	/* LookupDeviceIntRec */
-#include "exevents.h"
-#include "exglobals.h"
-
-#include "grabacc.h"
-
-/***********************************************************************
- *
- * This procedure allows a client to register as the global client to control
- * any window access.
- *
- */
-int
-SProcXGrabAccessControl(ClientPtr client)
-{
-    char n;
-    REQUEST(xGrabAccessControlReq);
-
-    swaps(&stuff->length, n);
-    return ProcXGrabAccessControl(client);
-}
-
-int
-ProcXGrabAccessControl(ClientPtr client)
-{
-    xGrabAccessControlReply rep;
-    REQUEST(xGrabAccessControlReq);
-    REQUEST_SIZE_MATCH(xGrabAccessControlReq);
-
-    if (stuff->ungrab)
-        ACUnregisterClient(client);
-
-    rep.repType = X_Reply;
-    rep.RepType = X_GrabAccessControl;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.success = stuff->ungrab || ACRegisterClient(client);
-
-    WriteReplyToClient(client, sizeof(xGrabAccessControlReply), &rep);
-    return Success;
-}
-
-/***********************************************************************
- *
- * This procedure writes the reply for the XGrabAccessControl function,
- * if the client and server have a different byte ordering.
- *
- */
-
-void
-SRepXGrabAccessControl(ClientPtr client, int size,
-        xGrabAccessControlReply* rep)
-{
-    char n;
-
-    swaps(&rep->sequenceNumber, n);
-    swapl(&rep->length, n);
-    WriteToClient(client, size, (char *)rep);
-}
-
diff --git a/Xi/grabacc.h b/Xi/grabacc.h
deleted file mode 100644
index 6dcbcad..0000000
--- a/Xi/grabacc.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
-
-Copyright 2007 Peter Hutterer <peter at cs.unisa.edu.au>
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the author shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from the author.
-
-*/
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#ifndef GRABACC_H
-#define GRABACC_H 1
-
-int SProcXGrabAccessControl(ClientPtr /* client */);
-
-int ProcXGrabAccessControl(ClientPtr /* client */);
-void SRepXGrabAccessControl(ClientPtr client, int size, 
-        xGrabAccessControlReply* rep);
-#endif /* GRABACC_H */
commit b81c330f70c4a4c8f37216aa4856c7f8db93a375
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Thu Feb 14 09:32:54 2008 +1030

    mi: remove RawDeviceEvent's ID changing.

diff --git a/mi/mieq.c b/mi/mieq.c
index a1a434a..a15b24f 100644
--- a/mi/mieq.c
+++ b/mi/mieq.c
@@ -246,11 +246,7 @@ ChangeDeviceID(DeviceIntPtr dev, xEvent* event)
     else if (type == GenericEvent)
     {
         /* FIXME: need to put something into XGE to make this saner */
-        if (GEIsType(event, IReqCode, XI_RawDeviceEvent))
-        {
-            rawDeviceEvent* raw = (rawDeviceEvent*)event;
-            raw->deviceid = dev->id;
-        } else if (GEIsType(event, IReqCode, XI_DeviceClassesChangedNotify))
+        if (GEIsType(event, IReqCode, XI_DeviceClassesChangedNotify))
         {
             // do nothing or drink a beer. your choice.
         } else
commit acb412d5399f865b5048fdd683147cea0f19f0c1
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Thu Feb 14 09:27:51 2008 +1030

    dix: Don't generate RawDeviceEvents anymore.
    
    These events have been removed from the protocol pending some more refinement
    and more thoughtful integration.

diff --git a/dix/getevents.c b/dix/getevents.c
index b704371..ee58f02 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -258,9 +258,9 @@ updateMotionHistory(DeviceIntPtr pDev, CARD32 ms, int first_valuator,
  */
 _X_EXPORT int
 GetMaximumEventsNum(void) {
-    /* Three base events -- raw event and device, plus valuator events.
+    /* One base event -- device, plus valuator events.
      *  Multiply by two if we're doing non-XKB key repeats. */
-    int ret = 2 + MAX_VALUATOR_EVENTS;
+    int ret = 1 + MAX_VALUATOR_EVENTS;
 
 #ifdef XKB
     if (noXkbExtension)
@@ -628,11 +628,9 @@ _X_EXPORT int
 GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons,
                  int flags, int first_valuator, int num_valuators,
                  int *valuators) {
-    int num_events = 0, final_valuator = 0, i;
+    int num_events = 0, final_valuator = 0;
     CARD32 ms = 0;
-    CARD32* valptr;
     deviceKeyButtonPointer *kbp = NULL;
-    rawDeviceEvent* ev;
     DeviceIntPtr master;
 
     /* Thanks to a broken lib, we _always_ have to chase DeviceMotionNotifies
@@ -687,35 +685,6 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons,
     if (first_valuator < 0 || final_valuator > pDev->valuator->numAxes)
         return 0;
 
-    /* fill up the raw event, after checking that it is large enough to
-     * accommodate all valuators.
-     */
-    if (events->evlen <
-            (sizeof(xEvent) + ((num_valuators - 4) * sizeof(CARD32))))
-    {
-        events->evlen = sizeof(xEvent) +
-            ((num_valuators - 4) * sizeof(CARD32));
-        events->event = realloc(events->event, events->evlen);
-        if (!events->event)
-            FatalError("Could not allocate event storage.\n");
-    }
-
-    ev = (rawDeviceEvent*)events->event;
-    ev->type = GenericEvent;
-    ev->evtype = XI_RawDeviceEvent;
-    ev->extension = IReqCode;
-    ev->length = (num_valuators > 4) ? (num_valuators - 4) : 0;
-    ev->event_type = type;
-    ev->buttons = buttons;
-    ev->num_valuators = num_valuators;
-    ev->first_valuator = first_valuator;
-    ev->deviceid = pDev->id;
-    valptr = &(ev->valuator0);
-    for (i = 0; i < num_valuators; i++, valptr++)
-        *valptr = valuators[i];
-
-    events++;
-
     /* Set x and y based on whether this is absolute or relative, and
      * accelerate if we need to. */
     if (flags & POINTER_ABSOLUTE) {


More information about the xorg-commit mailing list