xserver: Branch 'server-1.6-branch' - 12 commits

Keith Packard keithp at kemper.freedesktop.org
Mon Dec 1 11:52:04 PST 2008


 Xi/Makefile.am   |   18 ---
 Xi/chdevcur.c    |  111 --------------------
 Xi/chdevcur.h    |   39 -------
 Xi/chdevhier.c   |  305 -------------------------------------------------------
 Xi/chdevhier.h   |   42 -------
 Xi/exevents.c    |   49 --------
 Xi/extgrbdev.c   |  216 --------------------------------------
 Xi/extgrbdev.h   |   43 -------
 Xi/extinit.c     |  171 ------------------------------
 Xi/getcptr.c     |  108 -------------------
 Xi/getcptr.h     |   43 -------
 Xi/getvers.c     |   13 --
 Xi/listdev.c     |   34 ------
 Xi/opendev.c     |   11 -
 Xi/querydp.c     |  168 ------------------------------
 Xi/querydp.h     |   44 -------
 Xi/setcptr.c     |  103 ------------------
 Xi/setcptr.h     |   36 ------
 Xi/warpdevp.c    |  175 -------------------------------
 Xi/warpdevp.h    |   39 -------
 Xi/xiselev.c     |   81 --------------
 Xi/xiselev.h     |   40 -------
 configure.ac     |    2 
 dix/devices.c    |   20 ---
 dix/enterleave.c |   36 ------
 dix/events.c     |  202 +++---------------------------------
 dix/getevents.c  |   44 -------
 mi/mieq.c        |   11 -
 xkb/xkbEvents.c  |   33 ++++-
 29 files changed, 55 insertions(+), 2182 deletions(-)

New commits:
commit 862d5b2dc55e678921b3db710b2821b66d55ea2f
Author: Peter Hutterer <peter.hutterer at redhat.com>
Date:   Wed Nov 26 12:20:00 2008 +1000

    xkb: don't attempt to filter events for devices without key classes.
    
    Reported by Magnus Kessler.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at redhat.com>

diff --git a/xkb/xkbEvents.c b/xkb/xkbEvents.c
index 9d8ec0d..4d3debb 100644
--- a/xkb/xkbEvents.c
+++ b/xkb/xkbEvents.c
@@ -826,7 +826,8 @@ XkbSrvInfoPtr	xkbi;
             pXDev = inputInfo.keyboard;
     }
 
-    xkbi= pXDev->key->xkbInfo;
+    xkbi= (pXDev->key) ? pXDev->key->xkbInfo : NULL;
+
     if ( pClient->xkbClientFlags & _XkbClientInitialized ) {
 	if ((xkbDebugFlags&0x10)&&
 		((xE[0].u.u.type==KeyPress)||(xE[0].u.u.type==KeyRelease)||
@@ -848,6 +849,10 @@ XkbSrvInfoPtr	xkbi;
 	     	(_XkbIsReleaseEvent(xE[0].u.u.type)) ) {
 	    return False;
 	}
+
+        if (!xkbi)
+            return True;
+
 	if ((pXDev->deviceGrab.grab != NullGrab) 
                 && pXDev->deviceGrab.fromPassiveGrab &&
 	    ((xE[0].u.u.type==KeyPress)||(xE[0].u.u.type==KeyRelease)||
@@ -891,6 +896,9 @@ XkbSrvInfoPtr	xkbi;
     else {
 	register CARD8 	type;
 
+        if (!xkbi)
+            return True;
+
 	for (i=0;i<nEvents;i++) {
 	    type= xE[i].u.u.type;
 	    if ((xkbDebugFlags&0x4)&&
commit 41471afa7774a6598344ea7b488f993a0bd32e7f
Author: Peter Hutterer <peter.hutterer at redhat.com>
Date:   Fri Nov 28 14:55:15 2008 +1000

    xkb: Extra sanity checks to prevent dev->key == NULL dereferencing.

diff --git a/xkb/xkbEvents.c b/xkb/xkbEvents.c
index 67bd674..9d8ec0d 100644
--- a/xkb/xkbEvents.c
+++ b/xkb/xkbEvents.c
@@ -110,7 +110,7 @@ Time 		time;
 register CARD16	changed,bState;
 
     interest = kbd->xkb_interest;
-    if (!interest)
+    if (!interest || !kbd->key || !kbd->key->xkbInfo)
 	return;
     xkbi = kbd->key->xkbInfo;
     state= &xkbi->state;
@@ -169,6 +169,9 @@ XkbSrvInfoPtr	xkbi;
 unsigned	time = 0,initialized;
 CARD16		changed;
 
+    if (!kbd->key || !kbd->key->xkbInfo)
+        return;
+
     xkbi = kbd->key->xkbInfo;
     initialized= 0;
 
@@ -292,7 +295,7 @@ XkbInterestPtr		interest;
 Time 		 	time = 0;
 
     interest = kbd->xkb_interest;
-    if (!interest)
+    if (!interest || !kbd->key || !kbd->key->xkbInfo)
 	return;
     xkbi = kbd->key->xkbInfo;
  
@@ -402,6 +405,9 @@ CARD16		pitch,duration;
 Time 		time = 0;
 XID		winID = 0;
 
+    if (!kbd->key || !kbd->key->xkbInfo)
+        return;
+
     xkbi = kbd->key->xkbInfo;
 
     if ((force||(xkbi->desc->ctrls->enabled_ctrls&XkbAudibleBellMask))&&
@@ -617,11 +623,12 @@ XkbSrvInfoPtr	 xkbi;
 XkbInterestPtr	 interest;
 Time 		 time = 0;
 
-    xkbi = kbd->key->xkbInfo;
     interest = kbd->xkb_interest;
-    if (!interest)
+    if (!interest || !kbd->key || !kbd->key->xkbInfo)
 	return;
  
+    xkbi = kbd->key->xkbInfo;
+
     initialized = 0;
     pEv->mods= xkbi->state.mods;
     pEv->group= xkbi->state.group;
@@ -1004,6 +1011,10 @@ unsigned long	autoCtrls,autoValues;
 ClientPtr	client = NULL;
 
     found= False;
+
+    if (!dev->key || !dev->key->xkbInfo)
+        return found;
+
     autoCtrls= autoValues= 0;
     if ( dev->xkb_interest ) {
 	interest = dev->xkb_interest;
commit b983c4fa1ec13f6096badf9dd5ebbf55880bb6c1
Author: Peter Hutterer <peter.hutterer at redhat.com>
Date:   Wed Nov 26 21:35:34 2008 +1000

    Require inputproto 1.5
    
    Also claim to now support XI 1.5.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at redhat.com>

diff --git a/Xi/extinit.c b/Xi/extinit.c
index 51e0200..14eb3cb 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -307,8 +307,8 @@ static int XIClientPrivateKeyIndex;
 DevPrivateKey XIClientPrivateKey = &XIClientPrivateKeyIndex;
 
 static XExtensionVersion thisversion = { XI_Present,
-    XI_2_Major,
-    XI_2_Minor
+    XI_Add_DeviceProperties_Major,
+    XI_Add_DeviceProperties_Minor
 };
 
 
diff --git a/configure.ac b/configure.ac
index cfc0d42..8a02f27 100644
--- a/configure.ac
+++ b/configure.ac
@@ -664,7 +664,7 @@ XEXT_LIB='$(top_builddir)/Xext/libXext.la'
 XEXTXORG_LIB='$(top_builddir)/Xext/libXextbuiltin.la'
 
 dnl Core modules for most extensions, et al.
-REQUIRED_MODULES="[randrproto >= 1.2.99.1] [renderproto >= 0.9.3] [fixesproto >= 4.0] [damageproto >= 1.1] xcmiscproto [xextproto >= 7.0.3] [xproto >= 7.0.13] [xtrans >= 1.2.2] bigreqsproto resourceproto fontsproto [inputproto >= 1.9.99.6] [kbproto >= 1.0.3]"
+REQUIRED_MODULES="[randrproto >= 1.2.99.1] [renderproto >= 0.9.3] [fixesproto >= 4.0] [damageproto >= 1.1] xcmiscproto [xextproto >= 7.0.3] [xproto >= 7.0.13] [xtrans >= 1.2.2] bigreqsproto resourceproto fontsproto [inputproto >= 1.5] [kbproto >= 1.0.3]"
 REQUIRED_LIBS="xfont xau fontenc [pixman-1 >= 0.13.2]"
 
 dnl HAVE_DBUS is true if we actually have the D-Bus library, whereas
commit f245c46d291dc22f40fb839bf21d2620091a84ef
Author: Peter Hutterer <peter.hutterer at redhat.com>
Date:   Fri Nov 28 14:21:05 2008 +1000

    dix: don't detach SDs during grabs.

diff --git a/dix/events.c b/dix/events.c
index b024d9e..d7618c2 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1466,51 +1466,6 @@ CheckGrabForSyncs(DeviceIntPtr thisDev, Bool thisMode, Bool otherMode)
     ComputeFreezes();
 }
 
-/* Only ever used if a grab is called on an attached slave device. */
-static int GrabPrivateKeyIndex;
-static DevPrivateKey GrabPrivateKey = &GrabPrivateKeyIndex;
-typedef struct _GrabMemoryRec {
-    DeviceIntPtr oldmaster;
-} GrabMemoryRec, *GrabMemoryPtr;
-
-/**
- * Save the device's master device in the devPrivates. This needs to be done
- * if a client directly grabs a slave device that is attached to a master. For
- * the duration of the grab, the device is detached, ungrabbing re-attaches it
- * though.
- */
-static void
-SaveOldMaster(DeviceIntPtr dev)
-{
-    GrabMemoryPtr gm;
-
-    if (!(gm = xalloc(sizeof(GrabMemoryRec))))
-    {
-        ErrorF("[dix] Cannot allocate grab private. Grab not "
-                "possible on device.\n");
-        return;
-    }
-    gm->oldmaster = dev->u.master;
-    dixSetPrivate(&dev->devPrivates, GrabPrivateKey, gm);
-}
-
-static void
-RestoreOldMaster(DeviceIntPtr dev)
-{
-    GrabMemoryPtr gm;
-
-    if (dev->isMaster)
-        return;
-
-    gm = (GrabMemoryPtr)dixLookupPrivate(&dev->devPrivates, GrabPrivateKey);
-    if (gm)
-    {
-        dev->u.master = gm->oldmaster;
-        xfree(gm);
-        dixSetPrivate(&dev->devPrivates, GrabPrivateKey, NULL);
-    }
-}
-
 /**
  * Activate a pointer grab on the given device. A pointer grab will cause all
  * core pointer events of this device to be delivered to the grabbing client only.
@@ -1536,13 +1491,6 @@ ActivatePointerGrab(DeviceIntPtr mouse, GrabPtr grab,
                         : mouse->spriteInfo->sprite->win;
     Bool isPassive = autoGrab & ~ImplicitGrabMask;
 
-    /* slave devices need to float for the duration of the grab. */
-    if (!isPassive && !mouse->isMaster)
-    {
-        SaveOldMaster(mouse);
-        AttachDevice(NULL, mouse, NULL);
-    }
-
     if (grab->confineTo)
     {
 	if (grab->confineTo->drawable.pScreen
@@ -1577,7 +1525,6 @@ DeactivatePointerGrab(DeviceIntPtr mouse)
 {
     GrabPtr grab = mouse->deviceGrab.grab;
     DeviceIntPtr dev;
-    Bool  wasPassive= mouse->deviceGrab.fromPassiveGrab;
 
     mouse->valuator->motionHintWindow = NullWindow;
     mouse->deviceGrab.grab = NullGrab;
@@ -1604,9 +1551,6 @@ DeactivatePointerGrab(DeviceIntPtr mouse)
     if (grab->cursor)
 	FreeCursor(grab->cursor, (Cursor)0);
 
-    if (!wasPassive)
-        RestoreOldMaster(mouse);
-
     ComputeFreezes();
 }
 
@@ -1621,13 +1565,6 @@ ActivateKeyboardGrab(DeviceIntPtr keybd, GrabPtr grab, TimeStamp time, Bool pass
     GrabInfoPtr grabinfo = &keybd->deviceGrab;
     WindowPtr oldWin;
 
-    /* slave devices need to float for the duration of the grab. */
-    if (!passive && !keybd->isMaster)
-    {
-        SaveOldMaster(keybd);
-        AttachDevice(NULL, keybd, NULL);
-    }
-
     if (grabinfo->grab)
 	oldWin = grabinfo->grab->window;
     else if (keybd->focus)
@@ -1659,7 +1596,6 @@ DeactivateKeyboardGrab(DeviceIntPtr keybd)
     DeviceIntPtr dev;
     WindowPtr focusWin = keybd->focus ? keybd->focus->win
                                            : keybd->spriteInfo->sprite->win;
-    Bool wasPassive = keybd->deviceGrab.fromPassiveGrab;
 
     if (focusWin == FollowKeyboardWin)
 	focusWin = inputInfo.keyboard->focus->win;
@@ -1681,9 +1617,6 @@ DeactivateKeyboardGrab(DeviceIntPtr keybd)
     }
     DoFocusEvents(keybd, grab->window, focusWin, NotifyUngrab);
 
-    if (!wasPassive)
-        RestoreOldMaster(keybd);
-
     ComputeFreezes();
 }
 
commit 71f289f7d1b4fe79f25b229830047e71f50d8610
Author: Peter Hutterer <peter.hutterer at redhat.com>
Date:   Fri Nov 28 14:05:58 2008 +1000

    dix: Don't deliver XI events from MDs.
    
    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>

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  &&
commit c910886737bf6ce7a4bd44d2149a1f0a810453d2
Author: Peter Hutterer <peter.hutterer at redhat.com>
Date:   Fri Nov 28 13:49:40 2008 +1000

    Xi: Purge XGE remainders, we don't have any XGE events anymore.

diff --git a/Xi/extinit.c b/Xi/extinit.c
index 0ec5342..51e0200 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -120,14 +120,6 @@ int ExtEventIndex;
 Mask ExtValidMasks[EMASKSIZE];
 Mask ExtExclusiveMasks[EMASKSIZE];
 
-
-/**
- * Filters for various generic events.
- * Evtype is index, mask is value at index.
- */
-static Mask xi_filters[4] = {
-};
-
 static struct dev_type
 {
     Atom type;
@@ -965,32 +957,6 @@ SEventIDispatch(xEvent * from, xEvent * to)
     }
 }
 
-/****************************************************************
- *
- * EventSwap for generic events coming from the GE extension.
- */
-
-static void
-XIGEEventSwap(xGenericEvent* from, xGenericEvent* to)
-{
-    int n;
-
-    swaps(&from->sequenceNumber, n);
-    switch(from->evtype)
-    {
-    }
-}
-
-/**
- * EventFill to fill various fields for events before they are delivered to
- * the client.
- */
-static void
-XIGEEventFill(xGenericEvent* ev, DeviceIntPtr pDev,
-              WindowPtr pWin, GrabPtr grab)
-{
-}
-
 /**********************************************************************
  *
  * IExtensionInit - initialize the input extension.
@@ -1043,9 +1009,6 @@ XInputExtensionInit(void)
 	EventSwapVector[ChangeDeviceNotify] = SEventIDispatch;
 	EventSwapVector[DevicePresenceNotify] = SEventIDispatch;
 
-        /* init GE events */
-        GERegisterExtension(IReqCode, XIGEEventSwap, XIGEEventFill);
-        SetGenericFilter(IReqCode, xi_filters);
     } else {
 	FatalError("IExtensionInit: AddExtensions failed\n");
     }
commit be4bf65d00a28cc77b939f00f115528a9024ab89
Author: Peter Hutterer <peter.hutterer at redhat.com>
Date:   Fri Nov 28 09:22:04 2008 +1000

    input: don't switch MDs' classes around between SDs.
    
    Server 1.6 uses the X Input 1.x input model, where the core devices (VCP and
    VCK) do not generate XI events. They don't have to swap device classes but
    instead stay at the default number of classes at all times.
    This means we can get rid of the DeviceClassesChangedEvents as well.

diff --git a/Xi/exevents.c b/Xi/exevents.c
index fbd03aa..00a6b21 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -738,41 +738,6 @@ DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to)
     }
 }
 
-/**
- * Change MD to look like SD by copying all classes over. An event is sent to
- * all interested clients.
- * @param device The slave device
- * @param dcce Pointer to the event struct.
- */
-static void
-ChangeMasterDeviceClasses(DeviceIntPtr device,
-                          deviceClassesChangedEvent *dcce)
-{
-    DeviceIntPtr master = device->u.master;
-    char* classbuff;
-
-    if (device->isMaster)
-        return;
-
-    if (!master) /* if device was set floating between SIGIO and now */
-        return;
-
-    dcce->deviceid     = master->id;
-    dcce->num_classes  = 0;
-
-    master->public.devicePrivate = device->public.devicePrivate;
-
-    DeepCopyDeviceClasses(device, master);
-
-    /* event is already correct size, see comment in GetPointerEvents */
-    classbuff = (char*)&dcce[1];
-
-    /* we don't actually swap if there's a NullClient, swapping is done
-     * later when event is delivered. */
-    CopySwapClasses(NullClient, master, &dcce->num_classes, &classbuff);
-    SendEventToAllWindows(master, XI_DeviceClassesChangedMask,
-                          (xEvent*)dcce, 1);
-}
 
 /**
  * Update the device state according to the data in the event.
@@ -800,16 +765,6 @@ UpdateDeviceState(DeviceIntPtr device, xEvent* xE, int count)
     CARD16 modifiers    = 0,
            mask         = 0;
 
-    /* This event is always the first we get, before the actual events with
-     * the data. However, the way how the DDX is set up, "device" will
-     * actually be the slave device that caused the event.
-     */
-    if (GEIsType(xE, IReqCode, XI_DeviceClassesChangedNotify))
-    {
-        ChangeMasterDeviceClasses(device, (deviceClassesChangedEvent*)xE);
-        return DONT_PROCESS; /* event has been sent already */
-    }
-
     /* currently no other generic event modifies the device */
     if (xE->u.u.type == GenericEvent)
         return DEFAULT;
diff --git a/Xi/extinit.c b/Xi/extinit.c
index df71ae2..0ec5342 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -126,7 +126,6 @@ Mask ExtExclusiveMasks[EMASKSIZE];
  * Evtype is index, mask is value at index.
  */
 static Mask xi_filters[4] = {
-    XI_DeviceClassesChangedMask
 };
 
 static struct dev_type
@@ -558,53 +557,6 @@ SDevicePropertyNotifyEvent (devicePropertyNotify *from, devicePropertyNotify *to
     swapl(&to->atom, n);
 }
 
-static void
-SDeviceClassesChangedEvent(deviceClassesChangedEvent* from,
-                           deviceClassesChangedEvent* to)
-{
-    char n;
-    int i, j;
-    xAnyClassPtr any;
-
-    *to = *from;
-    memcpy(&to[1], &from[1], from->length * 4);
-
-    swaps(&to->sequenceNumber, n);
-    swapl(&to->length, n);
-    swapl(&to->time, n);
-   
-    /* now swap the actual classes */
-    any = (xAnyClassPtr)&to[1];
-    for (i = 0; i < to->num_classes; i++)
-    {
-        switch(any->class)
-        {
-            case KeyClass:
-                swaps(&((xKeyInfoPtr)any)->num_keys, n);
-                break;
-            case ButtonClass:
-                swaps(&((xButtonInfoPtr)any)->num_buttons, n);
-                break;
-            case ValuatorClass:
-                {
-                    xValuatorInfoPtr v = (xValuatorInfoPtr)any;
-                    xAxisInfoPtr a = (xAxisInfoPtr)&v[1];
-
-                    swapl(&v->motion_buffer_size, n);
-                    for (j = 0; j < v->num_axes; j++)
-                    {
-                        swapl(&a->min_value, n);
-                        swapl(&a->max_value, n);
-                        swapl(&a->resolution, n);
-                        a++;
-                    }
-                }
-                break;
-        }
-        any = (xAnyClassPtr)((char*)any + any->length);
-    }
-}
-
 /**************************************************************************
  *
  * Allow the specified event to have its propagation suppressed.
@@ -1026,10 +978,6 @@ XIGEEventSwap(xGenericEvent* from, xGenericEvent* to)
     swaps(&from->sequenceNumber, n);
     switch(from->evtype)
     {
-        case XI_DeviceClassesChangedNotify:
-            SDeviceClassesChangedEvent((deviceClassesChangedEvent*)from,
-                                       (deviceClassesChangedEvent*)to);
-            break;
     }
 }
 
diff --git a/dix/devices.c b/dix/devices.c
index f85e875..f7fef95 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -2568,26 +2568,6 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master)
         for (it = inputInfo.devices; it; it = it->next)
             if (!it->isMaster && it->u.master == oldmaster)
                 break;
-
-        if (!it)  /* no dev is paired with old master */
-        {
-            /* XXX: reset to defaults */
-            EventList event = { NULL, 0};
-            char* classbuf;
-
-            /* Send event to clients */
-            CreateClassesChangedEvent(&event, oldmaster, oldmaster);
-            deviceClassesChangedEvent *dcce =
-                (deviceClassesChangedEvent*)event.event;
-            dcce->deviceid = oldmaster->id;
-            dcce->num_classes = 0;
-            classbuf = (char*)&event.event[1];
-            CopySwapClasses(NullClient, oldmaster,
-                    &dcce->num_classes, &classbuf);
-            SendEventToAllWindows(oldmaster, XI_DeviceClassesChangedMask,
-                    event.event, 1);
-            xfree(event.event);
-        }
     }
 
     return Success;
diff --git a/dix/getevents.c b/dix/getevents.c
index 620ce93..82be5e9 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -60,7 +60,6 @@
 #include "exevents.h"
 #include "exglobals.h"
 #include "extnsionst.h"
-#include "listdev.h" /* for sizing up DeviceClassesChangedEvent */
 
 /* Maximum number of valuators, divided by six, rounded up, to get number
  * of events. */
@@ -117,43 +116,6 @@ key_autorepeats(DeviceIntPtr pDev, int key_code)
               (1 << (key_code & 7)));
 }
 
-void
-CreateClassesChangedEvent(EventList* event,
-                          DeviceIntPtr master,
-                          DeviceIntPtr slave)
-{
-    deviceClassesChangedEvent *dcce;
-    int len = sizeof(xEvent);
-    CARD32 ms = GetTimeInMillis();
-    int namelen = 0; /* dummy */
-
-    /* XXX: ok, this is a bit weird. We need to alloc enough size for the
-     * event so it can be filled in in POE lateron. Reason being that if
-     * we realloc the event in POE we can get SIGABRT when we try to free
-     * or realloc the original pointer.
-     * We can only do it here as we don't have the EventList in the event
-     * processing any more.
-     */
-    SizeDeviceInfo(slave, &namelen, &len);
-
-    if (event->evlen < len)
-    {
-        event->event = realloc(event->event, len);
-        if (!event->event)
-            FatalError("[dix] Cannot allocate memory for "
-                    "DeviceClassesChangedEvent.\n");
-        event->evlen = len;
-    }
-
-    dcce = (deviceClassesChangedEvent*)event->event;
-    dcce->type = GenericEvent;
-    dcce->extension = IReqCode;
-    dcce->evtype = XI_DeviceClassesChangedNotify;
-    dcce->time = ms;
-    dcce->new_slave = slave->id;
-    dcce->length = (len - sizeof(xEvent))/4;
-}
-
 /**
  * Rescale the coord between the two axis ranges.
  */
@@ -580,12 +542,9 @@ updateFromMaster(EventListPtr events, DeviceIntPtr dev, int *num_events)
     DeviceIntPtr master = dev->u.master;
     if (master && master->u.lastSlave != dev)
     {
-        CreateClassesChangedEvent(events, master, dev);
         updateSlaveDeviceCoords(master, dev);
         master->u.lastSlave = dev;
         master->last.numValuators = dev->last.numValuators;
-        (*num_events)++;
-        events++;
     }
     return events;
 }
@@ -1104,12 +1063,9 @@ GetProximityEvents(EventList *events, DeviceIntPtr pDev, int type,
     master = pDev->u.master;
     if (master && master->u.lastSlave != pDev)
     {
-        CreateClassesChangedEvent(events, master, pDev);
         updateSlaveDeviceCoords(master, pDev);
         master->u.lastSlave = pDev;
         master->last.numValuators = pDev->last.numValuators;
-        num_events++;
-        events++;
     }
 
     kbp = (deviceKeyButtonPointer *) events->event;
diff --git a/mi/mieq.c b/mi/mieq.c
index 82f0c66..87cdfba 100644
--- a/mi/mieq.c
+++ b/mi/mieq.c
@@ -254,14 +254,9 @@ ChangeDeviceID(DeviceIntPtr dev, xEvent* event)
         ((deviceValuator*)event)->deviceid = dev->id;
     else if (type == GenericEvent)
     {
-        /* FIXME: need to put something into XGE to make this saner */
-        if (GEIsType(event, IReqCode, XI_DeviceClassesChangedNotify))
-        {
-            // do nothing or drink a beer. your choice.
-        } else
-            DebugF("[mi] Unknown generic event (%d/%d), cannot change id.\n",
-                    ((xGenericEvent*)event)->extension,
-                    ((xGenericEvent*)event)->evtype);
+        DebugF("[mi] Unknown generic event (%d/%d), cannot change id.\n",
+                ((xGenericEvent*)event)->extension,
+                ((xGenericEvent*)event)->evtype);
     } else
         DebugF("[mi] Unknown event type (%d), cannot change id.\n", type);
 }
commit aba1cbaadcde50a7a25f8aee06b66eec67a9145e
Author: Peter Hutterer <peter.hutterer at redhat.com>
Date:   Fri Nov 28 09:19:49 2008 +1000

    dix: No DeviceEnterLeave events in server 1.6

diff --git a/Xi/exevents.c b/Xi/exevents.c
index c520c7d..fbd03aa 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -122,8 +122,6 @@ IsPointerEvent(xEvent* xE)
             if (xE->u.u.type == DeviceButtonPress ||
                 xE->u.u.type == DeviceButtonRelease ||
                 xE->u.u.type == DeviceMotionNotify ||
-                xE->u.u.type == DeviceEnterNotify ||
-                xE->u.u.type == DeviceLeaveNotify ||
                 xE->u.u.type == ProximityIn ||
                 xE->u.u.type == ProximityOut)
             {
@@ -145,8 +143,6 @@ XIGetDevice(xEvent* xE)
     if (xE->u.u.type == DeviceButtonPress ||
         xE->u.u.type == DeviceButtonRelease ||
         xE->u.u.type == DeviceMotionNotify ||
-        xE->u.u.type == DeviceEnterNotify ||
-        xE->u.u.type == DeviceLeaveNotify ||
         xE->u.u.type == ProximityIn ||
         xE->u.u.type == ProximityOut ||
         xE->u.u.type == DevicePropertyNotify)
diff --git a/Xi/extinit.c b/Xi/extinit.c
index d167b76..df71ae2 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -274,8 +274,6 @@ Mask DeviceButtonGrabMask;
 Mask DeviceButtonMotionMask;
 Mask DevicePresenceNotifyMask;
 Mask DevicePropertyNotifyMask;
-Mask DeviceEnterWindowMask;
-Mask DeviceLeaveWindowMask;
 
 int DeviceValuator;
 int DeviceKeyPress;
@@ -294,8 +292,6 @@ int DeviceMappingNotify;
 int ChangeDeviceNotify;
 int DevicePresenceNotify;
 int DevicePropertyNotify;
-int DeviceEnterNotify;
-int DeviceLeaveNotify;
 
 int RT_INPUTCLIENT;
 
@@ -563,23 +559,6 @@ SDevicePropertyNotifyEvent (devicePropertyNotify *from, devicePropertyNotify *to
 }
 
 static void
-SDeviceLeaveNotifyEvent (deviceLeaveNotify *from, deviceLeaveNotify *to)
-{
-    char n;
-
-    *to = *from;
-    swaps(&to->sequenceNumber,n);
-    swapl(&to->time, n);
-    swapl(&to->root, n);
-    swapl(&to->event, n);
-    swapl(&to->child, n);
-    swaps(&to->rootX, n);
-    swaps(&to->rootY, n);
-    swaps(&to->eventX, n);
-    swaps(&to->eventY, n);
-}
-
-static void
 SDeviceClassesChangedEvent(deviceClassesChangedEvent* from,
                            deviceClassesChangedEvent* to)
 {
@@ -750,8 +729,6 @@ FixExtensionEvents(ExtensionEntry * extEntry)
     DeviceButtonStateNotify = DeviceKeyStateNotify + 1;
     DevicePresenceNotify = DeviceButtonStateNotify + 1;
     DevicePropertyNotify = DevicePresenceNotify + 1;
-    DeviceEnterNotify = DevicePropertyNotify + 1;
-    DeviceLeaveNotify = DeviceEnterNotify + 1;
 
     event_base[KeyClass] = DeviceKeyPress;
     event_base[ButtonClass] = DeviceButtonPress;
@@ -843,14 +820,6 @@ FixExtensionEvents(ExtensionEntry * extEntry)
     DevicePropertyNotifyMask = GetNextExtEventMask();
     SetMaskForExtEvent(DevicePropertyNotifyMask, DevicePropertyNotify);
 
-    DeviceEnterWindowMask = GetNextExtEventMask();
-    SetMaskForExtEvent(DeviceEnterWindowMask, DeviceEnterNotify);
-    AllowPropagateSuppress(DeviceEnterWindowMask);
-
-    DeviceLeaveWindowMask = GetNextExtEventMask();
-    SetMaskForExtEvent(DeviceLeaveWindowMask, DeviceLeaveNotify);
-    AllowPropagateSuppress(DeviceLeaveWindowMask);
-
     SetEventInfo(0, _noExtensionEvent);
 }
 
@@ -897,8 +866,6 @@ RestoreExtensionEvents(void)
     DeviceButtonStateNotify = 13;
     DevicePresenceNotify = 14;
     DevicePropertyNotify = 15;
-    DeviceEnterNotify = 16;
-    DeviceLeaveNotify = 17;
 
     BadDevice = 0;
     BadEvent = 1;
@@ -938,8 +905,6 @@ IResetProc(ExtensionEntry * unused)
     EventSwapVector[ChangeDeviceNotify] = NotImplemented;
     EventSwapVector[DevicePresenceNotify] = NotImplemented;
     EventSwapVector[DevicePropertyNotify] = NotImplemented;
-    EventSwapVector[DeviceEnterNotify] = NotImplemented;
-    EventSwapVector[DeviceLeaveNotify] = NotImplemented;
     RestoreExtensionEvents();
 }
 
@@ -1043,10 +1008,6 @@ SEventIDispatch(xEvent * from, xEvent * to)
 	DO_SWAP(SDevicePresenceNotifyEvent, devicePresenceNotify);
     else if (type == DevicePropertyNotify)
 	DO_SWAP(SDevicePropertyNotifyEvent, devicePropertyNotify);
-    else if (type == DeviceEnterNotify)
-        DO_SWAP(SDeviceLeaveNotifyEvent, deviceEnterNotify);
-    else if (type == DeviceLeaveNotify)
-        DO_SWAP(SDeviceLeaveNotifyEvent, deviceLeaveNotify);
     else {
 	FatalError("XInputExtension: Impossible event!\n");
     }
@@ -1133,8 +1094,6 @@ XInputExtensionInit(void)
 	EventSwapVector[DeviceMappingNotify] = SEventIDispatch;
 	EventSwapVector[ChangeDeviceNotify] = SEventIDispatch;
 	EventSwapVector[DevicePresenceNotify] = SEventIDispatch;
-	EventSwapVector[DeviceEnterNotify] = SEventIDispatch;
-	EventSwapVector[DeviceLeaveNotify] = SEventIDispatch;
 
         /* init GE events */
         GERegisterExtension(IReqCode, XIGEEventSwap, XIGEEventFill);
diff --git a/dix/enterleave.c b/dix/enterleave.c
index 8176f96..d16f922 100644
--- a/dix/enterleave.c
+++ b/dix/enterleave.c
@@ -193,9 +193,6 @@ EnterNotifies(DeviceIntPtr dev,
     if (core)
         CoreEnterLeaveEvent(dev, EnterNotify, mode, detail, parent,
                             child->drawable.id);
-    else
-        DeviceEnterLeaveEvent(dev, DeviceEnterNotify, mode, detail, parent,
-                              child->drawable.id);
 }
 
 /**
@@ -219,9 +216,6 @@ LeaveNotifies(DeviceIntPtr dev,
         if (core)
             CoreEnterLeaveEvent(dev, LeaveNotify, mode, detail, win,
                             child->drawable.id);
-        else
-            DeviceEnterLeaveEvent(dev, DeviceLeaveNotify, mode, detail, win,
-                                  child->drawable.id);
         child = win;
     }
 }
@@ -489,35 +483,6 @@ CoreEnterLeaveEvents(DeviceIntPtr dev,
     EnterWindow(dev, to, mode);
 }
 
-static void
-DeviceEnterLeaveEvents(DeviceIntPtr dev,
-                       WindowPtr    from,
-                       WindowPtr    to,
-                       int          mode)
-{
-    if (IsParent(from, to))
-    {
-        DeviceEnterLeaveEvent(dev, DeviceLeaveNotify, mode, NotifyInferior, from, None);
-        EnterNotifies(dev, from, to, mode, NotifyVirtual, FALSE);
-        DeviceEnterLeaveEvent(dev, DeviceEnterNotify, mode, NotifyAncestor, to, None);
-    }
-    else if (IsParent(to, from))
-    {
-	DeviceEnterLeaveEvent(dev, DeviceLeaveNotify, mode, NotifyAncestor, from, None);
-	LeaveNotifies(dev, from, to, mode, NotifyVirtual, FALSE);
-	DeviceEnterLeaveEvent(dev, DeviceEnterNotify, mode, NotifyInferior, to, None);
-    }
-    else
-    { /* neither from nor to is descendent of the other */
-	WindowPtr common = CommonAncestor(to, from);
-	/* common == NullWindow ==> different screens */
-        DeviceEnterLeaveEvent(dev, DeviceLeaveNotify, mode, NotifyNonlinear, from, None);
-        LeaveNotifies(dev, from, common, mode, NotifyNonlinearVirtual, FALSE);
-	EnterNotifies(dev, common, to, mode, NotifyNonlinearVirtual, FALSE);
-        DeviceEnterLeaveEvent(dev, DeviceEnterNotify, mode, NotifyNonlinear, to, None);
-    }
-}
-
 /**
  * Figure out if enter/leave events are necessary and send them to the
  * appropriate windows.
@@ -538,5 +503,4 @@ DoEnterLeaveEvents(DeviceIntPtr pDev,
 	return;
 
     CoreEnterLeaveEvents(pDev, fromWin, toWin, mode);
-    DeviceEnterLeaveEvents(pDev, fromWin, toWin, mode);
 }
diff --git a/dix/events.c b/dix/events.c
index bfc8494..d1dc8ed 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -4274,79 +4274,6 @@ CoreEnterLeaveEvent(
     }
 }
 
-void
-DeviceEnterLeaveEvent(
-    DeviceIntPtr mouse,
-    int type,
-    int mode,
-    int detail,
-    WindowPtr pWin,
-    Window child)
-{
-    xEvent              event;
-    GrabPtr             grab = mouse->deviceGrab.grab;
-    deviceEnterNotify   *devEnterLeave;
-    int                 mskidx;
-    OtherInputMasks     *inputMasks;
-    Mask                mask;
-    DeviceIntPtr        keybd = GetPairedDevice(mouse);
-    BOOL                sameScreen;
-
-    if (grab) {
-        mask = (pWin == grab->window) ? grab->eventMask : 0;
-        if (grab->ownerEvents)
-            mask |= EventMaskForClient(pWin, rClient(grab));
-    } else {
-        mask = pWin->eventMask | wOtherEventMasks(pWin);
-    }
-
-    /* we don't have enough bytes, so we squash flags and mode into
-       one byte, and use the last byte for the deviceid. */
-    devEnterLeave           = (deviceEnterNotify*)&event;
-    devEnterLeave->detail   = detail;
-    devEnterLeave->time     = currentTime.milliseconds;
-    devEnterLeave->rootX    = mouse->spriteInfo->sprite->hot.x;
-    devEnterLeave->rootY    = mouse->spriteInfo->sprite->hot.y;
-    FixUpEventFromWindow(mouse, &event, pWin, None, FALSE);
-    sameScreen = event.u.keyButtonPointer.sameScreen;
-
-    devEnterLeave->child    = child;
-    devEnterLeave->type     = type;
-    devEnterLeave->deviceid = mouse->id;
-    devEnterLeave->mode     = mode;
-    devEnterLeave->mode    |= (sameScreen ?  (ELFlagSameScreen << 4) : 0);
-
-#ifdef XKB
-    if (!noXkbExtension) {
-        devEnterLeave->state = mouse->button->state & 0x1f00;
-        if (keybd)
-            devEnterLeave->state |=
-                XkbGrabStateFromRec(&keybd->key->xkbInfo->state);
-    } else
-#endif
-    {
-        devEnterLeave->state = (keybd) ? keybd->key->state : 0;
-        devEnterLeave->state |= mouse->button->state;
-    }
-
-    mskidx = mouse->id;
-    inputMasks = wOtherInputMasks(pWin);
-    if (inputMasks &&
-       (filters[mouse->id][devEnterLeave->type] &
-            inputMasks->deliverableEvents[mskidx]))
-    {
-        if (grab)
-            TryClientEvents(rClient(grab), mouse,
-                            (xEvent*)devEnterLeave, 1, mask,
-                            filters[mouse->id][devEnterLeave->type], grab);
-        else
-            DeliverEventsToWindow(mouse, pWin, (xEvent*)devEnterLeave, 1,
-                                  filters[mouse->id][devEnterLeave->type],
-                                  NullGrab, mouse->id);
-    }
-
-}
-
 static void
 FocusEvent(DeviceIntPtr dev, int type, int mode, int detail, WindowPtr pWin)
 {
diff --git a/xkb/xkbEvents.c b/xkb/xkbEvents.c
index 151849c..67bd674 100644
--- a/xkb/xkbEvents.c
+++ b/xkb/xkbEvents.c
@@ -921,10 +921,6 @@ XkbSrvInfoPtr	xkbi;
 		     new|= xkbi->state.compat_lookup_mods;
 		else new|= xkbi->state.compat_grab_mods;
                 kbp->state= new;
-            } else if ((type==DeviceEnterNotify)||(type==DeviceLeaveNotify)) {
-                deviceEnterNotify *del = (deviceEnterNotify*)&xE[i];
-                del->state&=0x1F00;
-                del->state|= xkbi->state.compat_grab_mods;
             }
 	    button_mask = 1 << xE[i].u.u.detail;
 	    if (type == ButtonPress &&
commit 9739fac04520e3e0c338f74cedb58855a17fc899
Author: Peter Hutterer <peter.hutterer at redhat.com>
Date:   Fri Nov 28 09:38:49 2008 +1000

    Xi: don't allow VCP/VCK be OpenDevice'd, but allow all SDs.
    
    Reverting to traditional XI behaviour.

diff --git a/Xi/opendev.c b/Xi/opendev.c
index c51bb7e..8d24927 100644
--- a/Xi/opendev.c
+++ b/Xi/opendev.c
@@ -99,7 +99,6 @@ ProcXOpenDevice(ClientPtr client)
     int status = Success;
     xOpenDeviceReply rep;
     DeviceIntPtr dev;
-    XIClientPtr pXIClient;
 
     REQUEST(xOpenDeviceReq);
     REQUEST_SIZE_MATCH(xOpenDeviceReq);
@@ -115,14 +114,8 @@ ProcXOpenDevice(ClientPtr client)
     } else if (status != Success)
 	return status;
 
-    /* Don't let XI 1.x clients open devices other than floating SDs. */
-    pXIClient = dixLookupPrivate(&client->devPrivates, XIClientPrivateKey);
-    if (pXIClient->major_version < XI_2_Major)
-    {
-        if (dev->isMaster || (!dev->isMaster && dev->u.master))
-            return BadDevice;
-    }
-
+    if (dev->isMaster)
+        return BadDevice;
 
     OpenInputDevice(dev, client, &status);
     if (status != Success)
commit 7330cb56501defb0002815767d2dc7f5b2b8ca1c
Author: Peter Hutterer <peter.hutterer at redhat.com>
Date:   Fri Nov 28 09:35:48 2008 +1000

    Xi: don't list attachment in ListInputDevices, but list all SDs.
    
    In XI2, we only list the VCP and the VCK as well as floating SDs to non-XI2
    clients. This is not the case here, we just list all devices.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at redhat.com>

diff --git a/Xi/listdev.c b/Xi/listdev.c
index ce549da..56ba2f6 100644
--- a/Xi/listdev.c
+++ b/Xi/listdev.c
@@ -187,10 +187,6 @@ CopySwapDevice(ClientPtr client, DeviceIntPtr d, int num_classes,
         dev->use = IsXExtensionPointer;
     else
 	dev->use = IsXExtensionDevice;
-    if (!d->isMaster)
-        dev->attached = (d->u.master) ? d->u.master->id : IsFloating;
-    else
-        dev->attached = GetPairedDevice(d)->id;
 
     if (client->swapped) {
 	swapl(&dev->type, n);	/* macro - braces are required */
@@ -348,16 +344,6 @@ ProcXListInputDevices(ClientPtr client)
     AddOtherInputDevices();
 
     for (d = inputInfo.devices; d; d = d->next) {
-        if (pXIClient->major_version < XI_2_Major)
-        {
-            if (d->isMaster &&
-                d != inputInfo.pointer &&
-                d != inputInfo.keyboard)
-                continue; /* don't send master devices other than VCP/VCK */
-
-            if (!d->isMaster && d->u.master)
-                continue; /* don't send attached SDs */
-        }
         rc = XaceHook(XACE_DEVICE_ACCESS, client, d, DixGetAttrAccess);
         if (rc != Success)
             return rc;
@@ -366,11 +352,6 @@ ProcXListInputDevices(ClientPtr client)
     }
 
     for (d = inputInfo.off_devices; d; d = d->next) {
-        if (pXIClient->major_version < XI_2_Major &&
-            !d->isMaster &&
-            d->u.master) /* XXX can off_devices be attached? */
-                continue; /* don't send attached SDs */
-
         rc = XaceHook(XACE_DEVICE_ACCESS, client, d, DixGetAttrAccess);
         if (rc != Success)
             return rc;
@@ -387,26 +368,11 @@ ProcXListInputDevices(ClientPtr client)
     dev = (xDeviceInfoPtr) devbuf;
     for (d = inputInfo.devices; d; d = d->next)
     {
-        if (pXIClient->major_version < XI_2_Major)
-        {
-            if (d->isMaster &&
-                    d != inputInfo.pointer &&
-                    d != inputInfo.keyboard)
-                continue; /* don't count master devices other than VCP/VCK */
-
-            if (!d->isMaster && d->u.master)
-                continue; /* don't count attached SDs */
-        }
         ListDeviceInfo(client, d, dev++, &devbuf, &classbuf, &namebuf);
     }
 
     for (d = inputInfo.off_devices; d; d = d->next)
     {
-        if (pXIClient->major_version < XI_2_Major &&
-                !d->isMaster &&
-                d->u.master) /* XXX can off_devices be attached? */
-            continue; /* don't send attached SDs */
-
         ListDeviceInfo(client, d, dev++, &devbuf, &classbuf, &namebuf);
     }
     rep.ndevices = numdevs;
commit 1d307ed7f268d3bb511985c18d580ab8a104ed41
Author: Peter Hutterer <peter.hutterer at redhat.com>
Date:   Fri Nov 28 09:34:56 2008 +1000

    Xi: remove the GetExtensionVersion hack - don't reply with supported version.
    
    XI2 abuses the GEV request to reply with the min/major version of the
    supported extension if the length for the name is 0. Don't do that, yet.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at redhat.com>

diff --git a/Xi/getvers.c b/Xi/getvers.c
index 43a1a4d..88ff199 100644
--- a/Xi/getvers.c
+++ b/Xi/getvers.c
@@ -105,19 +105,6 @@ ProcXGetExtensionVersion(ClientPtr client)
 
     pXIClient = dixLookupPrivate(&client->devPrivates, XIClientPrivateKey);
 
-    /* GetExtensionVersionReq before XI 2 didn't supply the client's
-     * major/minor. So we don't actually have a clue what they support.
-     * {major|minor}Version was added as part of XI, so if they are set, we
-     * know we can trust it. In this case the client must set nbytes to 0
-     * though, otherwise we have to assume that the version are padding
-     * garbage.
-     */
-    if (!stuff->nbytes) /* Client using XQueryInputVersion(). */
-    {
-        pXIClient->major_version = stuff->majorVersion;
-        pXIClient->minor_version = stuff->minorVersion;
-    } /* else version unknown, leave it at 0.0 */
-
     rep.repType = X_Reply;
     rep.RepType = X_GetExtensionVersion;
     rep.length = 0;
commit cfe7301bcf134ade26a81764be2ca5890eb29d5d
Author: Peter Hutterer <peter.hutterer at redhat.com>
Date:   Wed Nov 26 21:40:05 2008 +1000

    Xi: remove all new XI2 protocol requests and their handling.
    
    This commit reverts to XI 1.4 requests, plus the input device property
    requests.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at redhat.com>

diff --git a/Xi/Makefile.am b/Xi/Makefile.am
index 09dd41d..557e207 100644
--- a/Xi/Makefile.am
+++ b/Xi/Makefile.am
@@ -5,12 +5,8 @@ AM_CFLAGS = $(DIX_CFLAGS)
 libXi_la_SOURCES =	\
 	allowev.c \
 	allowev.h \
-        chdevcur.c \
-        chdevcur.h \
 	chgdctl.c \
 	chgdctl.h \
-        chdevhier.c \
-        chdevhier.h \
 	chgfctl.c \
 	chgfctl.h \
 	chgkbd.c \
@@ -27,13 +23,9 @@ libXi_la_SOURCES =	\
 	devbell.h \
 	exevents.c \
 	exglobals.h \
-        extgrbdev.c \
-        extgrbdev.h \
 	extinit.c \
 	getbmap.c \
 	getbmap.h \
-	getcptr.c \
-	getcptr.h \
 	getdctl.c \
 	getdctl.h \
 	getfctl.c \
@@ -62,8 +54,6 @@ libXi_la_SOURCES =	\
 	listdev.h \
 	opendev.c \
 	opendev.h \
-	querydp.c \
-	querydp.h \
 	queryst.c \
 	queryst.h \
 	selectev.c \
@@ -72,8 +62,6 @@ libXi_la_SOURCES =	\
 	sendexev.h \
 	setbmap.c \
 	setbmap.h \
-	setcptr.c \
-	setcptr.h \
 	setdval.c \
 	setdval.h \
 	setfocus.c \
@@ -88,11 +76,7 @@ libXi_la_SOURCES =	\
 	ungrdevb.h \
 	ungrdevk.c \
 	ungrdevk.h \
-	warpdevp.c \
-	warpdevp.h \
 	xiproperty.c \
-	xiproperty.h \
-	xiselev.c \
-	xiselev.h
+	xiproperty.h
 
 EXTRA_DIST = stubs.c
diff --git a/Xi/chdevcur.c b/Xi/chdevcur.c
deleted file mode 100644
index 121f792..0000000
--- a/Xi/chdevcur.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright 2007-2008 Peter Hutterer
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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.
- *
- * Author: Peter Hutterer, University of South Australia, NICTA
- */
-
-/***********************************************************************
- *
- * Request to change a given device pointer's cursor.
- *
- */
-
-#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 "input.h"
-
-#include "chdevcur.h"
-
-/***********************************************************************
- *
- * This procedure allows a client to set one pointer's cursor.
- *
- */
-
-int
-SProcXChangeDeviceCursor(ClientPtr client)
-{
-    char n;
-
-    REQUEST(xChangeDeviceCursorReq);
-    swaps(&stuff->length, n);
-    REQUEST_SIZE_MATCH(xChangeDeviceCursorReq);
-    return (ProcXChangeDeviceCursor(client));
-}
-
-int ProcXChangeDeviceCursor(ClientPtr client)
-{
-    int rc;
-    WindowPtr pWin    = NULL;
-    DeviceIntPtr pDev = NULL;
-    CursorPtr pCursor = NULL;
-
-    REQUEST(xChangeDeviceCursorReq);
-    REQUEST_SIZE_MATCH(xChangeDeviceCursorReq);
-
-    rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixSetAttrAccess);
-    if (rc != Success)
-        return rc;
-
-    if (stuff->win != None)
-    {
-        rc = dixLookupWindow(&pWin, stuff->win, client, DixSetAttrAccess);
-        if (rc != Success)
-            return rc;
-    }
-
-    if (stuff->cursor == None)
-    {
-        if (pWin == WindowTable[pWin->drawable.pScreen->myNum])
-            pCursor = rootCursor;
-        else
-            pCursor = (CursorPtr)None;
-    }
-    else
-    {
-        pCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor,
-                                RT_CURSOR, DixReadAccess);
-        if (!pCursor)
-        {
-            return BadCursor;
-        }
-    }
-
-    ChangeWindowDeviceCursor(pWin, pDev, pCursor);
-
-    return Success;
-}
-
diff --git a/Xi/chdevcur.h b/Xi/chdevcur.h
deleted file mode 100644
index e6df9eb..0000000
--- a/Xi/chdevcur.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright 2007-2008 Peter Hutterer
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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.
- *
- * Author: Peter Hutterer, University of South Australia, NICTA
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#ifndef CHDEVCUR_H
-#define CHDEVCUR_H 1
-
-int SProcXChangeDeviceCursor(ClientPtr	/* client */
-    );
-
-int ProcXChangeDeviceCursor(ClientPtr	/* client */
-    );
-
-#endif /* CHDEVCUR_H */
diff --git a/Xi/chdevhier.c b/Xi/chdevhier.c
deleted file mode 100644
index db16349..0000000
--- a/Xi/chdevhier.c
+++ /dev/null
@@ -1,305 +0,0 @@
-/*
- * Copyright 2007-2008 Peter Hutterer
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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.
- *
- * Author: Peter Hutterer, University of South Australia, NICTA
- */
-
-/***********************************************************************
- *
- * Request change in the device hierarchy.
- *
- */
-
-
-#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 <X11/extensions/geproto.h>
-#include "extnsionst.h"
-#include "exevents.h"
-#include "exglobals.h"
-#include "geext.h"
-#include "xace.h"
-
-#include "chdevhier.h"
-
-
-/***********************************************************************
- *
- * This procedure allows a client to change the device hierarchy through
- * adding new master devices, removing them, etc.
- *
- */
-
-int SProcXChangeDeviceHierarchy(ClientPtr client)
-{
-    char n;
-
-    REQUEST(xChangeDeviceHierarchyReq);
-    swaps(&stuff->length, n);
-    return (ProcXChangeDeviceHierarchy(client));
-}
-
-#define SWAPIF(cmd) if (client->swapped) { cmd; }
-
-int
-ProcXChangeDeviceHierarchy(ClientPtr client)
-{
-    DeviceIntPtr ptr, keybd;
-    DeviceIntRec dummyDev;
-    xAnyHierarchyChangeInfo *any;
-    int required_len = sizeof(xChangeDeviceHierarchyReq);
-    char n;
-    int rc = Success;
-    int nchanges = 0;
-    deviceHierarchyChangedEvent ev;
-
-    REQUEST(xChangeDeviceHierarchyReq);
-    REQUEST_AT_LEAST_SIZE(xChangeDeviceHierarchyReq);
-
-    any = (xAnyHierarchyChangeInfo*)&stuff[1];
-    while(stuff->num_changes--)
-    {
-        SWAPIF(swapl(&any->type, n));
-        SWAPIF(swaps(&any->length, n));
-
-        required_len += any->length;
-        if ((stuff->length * 4) < required_len)
-            return BadLength;
-
-        switch(any->type)
-        {
-            case CH_CreateMasterDevice:
-                {
-                    xCreateMasterInfo* c = (xCreateMasterInfo*)any;
-                    char* name;
-
-                    SWAPIF(swaps(&c->namelen, n));
-                    name = xcalloc(c->namelen + 1, sizeof(char));
-                    strncpy(name, (char*)&c[1], c->namelen);
-
-
-                    rc = AllocMasterDevice(client, name, &ptr, &keybd);
-                    if (rc != Success)
-                    {
-                        xfree(name);
-                        goto unwind;
-                    }
-
-                    if (!c->sendCore)
-                        ptr->coreEvents = keybd->coreEvents =  FALSE;
-
-                    ActivateDevice(ptr);
-                    ActivateDevice(keybd);
-
-                    if (c->enable)
-                    {
-                        EnableDevice(ptr);
-                        EnableDevice(keybd);
-                    }
-                    xfree(name);
-                    nchanges++;
-                }
-                break;
-            case CH_RemoveMasterDevice:
-                {
-                    xRemoveMasterInfo* r = (xRemoveMasterInfo*)any;
-
-                    if (r->returnMode != AttachToMaster &&
-                            r->returnMode != Floating)
-                        return BadValue;
-
-                    rc = dixLookupDevice(&ptr, r->deviceid, client,
-                                         DixDestroyAccess);
-                    if (rc != Success)
-                        goto unwind;
-
-                    if (!ptr->isMaster)
-                    {
-                        client->errorValue = r->deviceid;
-                        rc = BadDevice;
-                        goto unwind;
-                    }
-
-                    /* XXX: For now, don't allow removal of VCP, VCK */
-                    if (ptr == inputInfo.pointer ||
-                            ptr == inputInfo.keyboard)
-                    {
-                        rc = BadDevice;
-                        goto unwind;
-                    }
-
-                    /* disable keyboards first */
-                    if (IsPointerDevice(ptr))
-                    {
-                        rc = dixLookupDevice(&keybd,
-                                             ptr->spriteInfo->paired->id,
-                                             client,
-                                             DixDestroyAccess);
-                        if (rc != Success)
-                            goto unwind;
-                    }
-                    else
-                    {
-                        keybd = ptr;
-                        rc = dixLookupDevice(&ptr,
-                                             keybd->spriteInfo->paired->id,
-                                             client,
-                                             DixDestroyAccess);
-                        if (rc != Success)
-                            goto unwind;
-                    }
-
-
-                    /* Disabling sends the devices floating, reattach them if
-                     * desired. */
-                    if (r->returnMode == AttachToMaster)
-                    {
-                        DeviceIntPtr attached,
-                                     newptr,
-                                     newkeybd;
-
-                        rc = dixLookupDevice(&newptr, r->returnPointer,
-                                             client, DixWriteAccess);
-                        if (rc != Success)
-                            goto unwind;
-
-                        if (!newptr->isMaster)
-                        {
-                            client->errorValue = r->returnPointer;
-                            rc = BadDevice;
-                            goto unwind;
-                        }
-
-                        rc = dixLookupDevice(&newkeybd, r->returnKeyboard,
-                                             client, DixWriteAccess);
-                        if (rc != Success)
-                            goto unwind;
-
-                        if (!newkeybd->isMaster)
-                        {
-                            client->errorValue = r->returnKeyboard;
-                            rc = BadDevice;
-                            goto unwind;
-                        }
-
-                        for (attached = inputInfo.devices;
-                                attached;
-                                attached = attached->next)
-                        {
-                            if (!attached->isMaster) {
-                                if (attached->u.master == ptr)
-                                    AttachDevice(client, attached, newptr);
-                                if (attached->u.master == keybd)
-                                    AttachDevice(client, attached, newkeybd);
-                            }
-                        }
-                    }
-
-                    /* can't disable until we removed pairing */
-                    keybd->spriteInfo->paired = NULL;
-                    ptr->spriteInfo->paired = NULL;
-                    DisableDevice(keybd);
-                    DisableDevice(ptr);
-
-                    RemoveDevice(keybd);
-                    RemoveDevice(ptr);
-                    nchanges++;
-                }
-                break;
-            case CH_ChangeAttachment:
-                {
-                    xChangeAttachmentInfo* c = (xChangeAttachmentInfo*)any;
-
-                    rc = dixLookupDevice(&ptr, c->deviceid, client,
-                                          DixWriteAccess);
-                    if (rc != Success)
-                       goto unwind;
-
-                    if (ptr->isMaster)
-                    {
-                        client->errorValue = c->deviceid;
-                        rc = BadDevice;
-                        goto unwind;
-                    }
-
-                    if (c->changeMode == Floating)
-                        AttachDevice(client, ptr, NULL);
-                    else
-                    {
-                        DeviceIntPtr newmaster;
-                        rc = dixLookupDevice(&newmaster, c->newMaster,
-                                             client, DixWriteAccess);
-                        if (rc != Success)
-                            goto unwind;
-                        if (!newmaster->isMaster)
-                        {
-                            client->errorValue = c->newMaster;
-                            rc = BadDevice;
-                            goto unwind;
-                        }
-
-                        if (!((IsPointerDevice(newmaster) &&
-                                    IsPointerDevice(ptr)) ||
-                                (IsKeyboardDevice(newmaster) &&
-                                 IsKeyboardDevice(ptr))))
-                        {
-                            rc = BadDevice;
-                            goto unwind;
-                        }
-                        AttachDevice(client, ptr, newmaster);
-                    }
-                    nchanges++;
-                }
-                break;
-        }
-
-        any = (xAnyHierarchyChangeInfo*)((char*)any + any->length);
-    }
-
-unwind:
-
-    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;
-}
-
diff --git a/Xi/chdevhier.h b/Xi/chdevhier.h
deleted file mode 100644
index 07afd53..0000000
--- a/Xi/chdevhier.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2007-2008 Peter Hutterer
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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.
- *
- * Author: Peter Hutterer, University of South Australia, NICTA
- */
-
-/***********************************************************************
- *
- * Request change in the device hierarchy.
- *
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#ifndef CHDEVHIER_H
-#define CHDEVHIER_H 1
-
-int SProcXChangeDeviceHierarchy(ClientPtr /* client */);
-int ProcXChangeDeviceHierarchy(ClientPtr /* client */);
-
-#endif
diff --git a/Xi/extgrbdev.c b/Xi/extgrbdev.c
deleted file mode 100644
index 050984a..0000000
--- a/Xi/extgrbdev.c
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * Copyright 2007-2008 Peter Hutterer
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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.
- *
- * Author: Peter Hutterer, University of South Australia, NICTA
- */
-
-/***********************************************************************
- *
- * 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 <X11/extensions/Xge.h>
-#include "extnsionst.h"
-#include "exevents.h"
-#include "exglobals.h"
-
-#include "grabdev.h"    /* CreateMaskFromList */
-
-#include "extgrbdev.h"
-
-int
-SProcXExtendedGrabDevice(ClientPtr client)
-{
-    char        n;
-    int         i;
-    long*       p;
-
-    REQUEST(xExtendedGrabDeviceReq);
-    swaps(&stuff->length, n);
-    REQUEST_AT_LEAST_SIZE(xExtendedGrabDeviceReq);
-
-    swapl(&stuff->grab_window, n);
-    swapl(&stuff->time, n);
-    swapl(&stuff->confine_to, n);
-    swapl(&stuff->cursor, n);
-    swaps(&stuff->event_count, n);
-    swaps(&stuff->generic_event_count, n);
-
-    p = (long *)&stuff[1];
-    for (i = 0; i < stuff->event_count; i++) {
-	swapl(p, n);
-	p++;
-    }
-
-    for (i = 0; i < stuff->generic_event_count; i++) {
-        p++; /* first 4 bytes are extension type and padding */
-        swapl(p, n);
-        p++;
-    }
-
-    return ProcXExtendedGrabDevice(client);
-}
-
-
-int
-ProcXExtendedGrabDevice(ClientPtr client)
-{
-    xExtendedGrabDeviceReply rep;
-    DeviceIntPtr             dev;
-    int                      rc = Success,
-                             errval = 0,
-                             i;
-    WindowPtr                grab_window,
-                             confineTo = 0;
-    CursorPtr                cursor = NULL;
-    struct tmask             tmp[EMASKSIZE];
-    TimeStamp                time;
-    XGenericEventMask*       xgeMask;
-    GenericMaskPtr           gemasks = NULL;
-
-    REQUEST(xExtendedGrabDeviceReq);
-    REQUEST_AT_LEAST_SIZE(xExtendedGrabDeviceReq);
-
-    rep.repType         = X_Reply;
-    rep.RepType         = X_ExtendedGrabDevice;
-    rep.sequenceNumber  = client->sequence;
-    rep.length          = 0;
-
-    if (stuff->length != (sizeof(xExtendedGrabDeviceReq) >> 2) +
-            stuff->event_count + 2 * stuff->generic_event_count)
-    {
-        errval = 0;
-        rc = BadLength;
-        goto cleanup;
-    }
-
-    rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
-    if (rc != Success) {
-	goto cleanup;
-    }
-
-    rc = dixLookupWindow(&grab_window,
-                          stuff->grab_window,
-                          client,
-                          DixReadAccess);
-    if (rc != Success)
-    {
-        errval = stuff->grab_window;
-        goto cleanup;
-    }
-
-    if (stuff->confine_to)
-    {
-        rc = dixLookupWindow(&confineTo,
-                              stuff->confine_to,
-                              client,
-                              DixReadAccess);
-        if (rc != Success)
-        {
-            errval = stuff->confine_to;
-            goto cleanup;
-        }
-    }
-
-    if (stuff->cursor)
-    {
-        cursor = (CursorPtr)SecurityLookupIDByType(client,
-                                                    stuff->cursor,
-                                                    RT_CURSOR,
-                                                    DixReadAccess);
-        if (!cursor)
-        {
-            errval = stuff->cursor;
-            rc = BadCursor;
-            goto cleanup;
-        }
-    }
-
-    if (CreateMaskFromList(client,
-                           (XEventClass*)&stuff[1],
-                           stuff->event_count,
-                           tmp,
-                           dev,
-                           X_GrabDevice) != Success)
-        return Success;
-
-    time = ClientTimeToServerTime(stuff->time);
-
-    if (stuff->generic_event_count)
-    {
-        xgeMask =
-            (XGenericEventMask*)(((XEventClass*)&stuff[1]) + stuff->event_count);
-
-        gemasks = xcalloc(1, sizeof(GenericMaskRec));
-        gemasks->resource = FakeClientID(client->index);
-        gemasks->next = NULL;
-        gemasks->eventMask[xgeMask->extension & 0x7F] = xgeMask->evmask;
-
-        xgeMask++;
-        for (i = 1; i < stuff->generic_event_count; i++, xgeMask++)
-            gemasks->eventMask[xgeMask->extension & 0x7F]= xgeMask->evmask;
-    }
-
-    rep.status = ExtGrabDevice(client, dev, stuff->device_mode,
-                               grab_window, confineTo, time,
-                               stuff->owner_events, cursor,
-                               tmp[stuff->deviceid].mask,
-                               gemasks);
-cleanup:
-
-    if (gemasks)
-        xfree(gemasks);
-
-    if (rc == Success)
-    {
-        WriteReplyToClient(client, sizeof(xGrabDeviceReply), &rep);
-    }
-    else
-    {
-        return rc;
-    }
-    return Success;
-}
-
-void
-SRepXExtendedGrabDevice(ClientPtr client, int size,
-                        xExtendedGrabDeviceReply* rep)
-{
-    char n;
-    swaps(&rep->sequenceNumber, n);
-    swaps(&rep->length, n);
-    WriteToClient(client, size, (char*)rep);
-}
diff --git a/Xi/extgrbdev.h b/Xi/extgrbdev.h
deleted file mode 100644
index 6e3e371..0000000
--- a/Xi/extgrbdev.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2007-2008 Peter Hutterer
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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.
- *
- * Author: Peter Hutterer, University of South Australia, NICTA
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#ifndef EXTGRBDEV_H
-#define EXTGRBDEV_H 1
-
-int SProcXExtendedGrabDevice(ClientPtr	/* client */
-    );
-
-int ProcXExtendedGrabDevice(ClientPtr	/* client */
-    );
-
-void SRepXExtendedGrabDevice(ClientPtr   client, 
-                            int         size, 
-                            xExtendedGrabDeviceReply* rep);
-
-#endif /* EXTGRBDEV_H */
diff --git a/Xi/extinit.c b/Xi/extinit.c
index 673a7ee..d167b76 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -76,19 +76,15 @@ SOFTWARE.
 
 /* modules local to Xi */
 #include "allowev.h"
-#include "chdevcur.h"
 #include "chgdctl.h"
-#include "chdevhier.h"
 #include "chgfctl.h"
 #include "chgkbd.h"
 #include "chgprop.h"
 #include "chgptr.h"
 #include "closedev.h"
-#include "extgrbdev.h"
 #include "devbell.h"
 #include "getbmap.h"
 #include "getbmap.h"
-#include "getcptr.h"
 #include "getdctl.h"
 #include "getfctl.h"
 #include "getfocus.h"
@@ -104,13 +100,11 @@ SOFTWARE.
 #include "gtmotion.h"
 #include "listdev.h"
 #include "opendev.h"
-#include "querydp.h"
 #include "queryst.h"
 #include "selectev.h"
 #include "sendexev.h"
 #include "chgkmap.h"
 #include "setbmap.h"
-#include "setcptr.h"
 #include "setdval.h"
 #include "setfocus.h"
 #include "setmmap.h"
@@ -118,8 +112,6 @@ SOFTWARE.
 #include "ungrdev.h"
 #include "ungrdevb.h"
 #include "ungrdevk.h"
-#include "warpdevp.h"
-#include "xiselev.h"
 #include "xiproperty.h"
 
 
@@ -134,8 +126,7 @@ Mask ExtExclusiveMasks[EMASKSIZE];
  * Evtype is index, mask is value at index.
  */
 static Mask xi_filters[4] = {
-    XI_DeviceHierarchyChangedMask,
-    XI_DeviceClassesChangedMask,
+    XI_DeviceClassesChangedMask
 };
 
 static struct dev_type
@@ -211,16 +202,7 @@ static int (*ProcIVector[])(ClientPtr) = {
         ProcXListDeviceProperties,              /* 36 */
         ProcXChangeDeviceProperty,              /* 37 */
         ProcXDeleteDeviceProperty,              /* 38 */
-        ProcXGetDeviceProperty,                 /* 39 */
-        /* XI 2 */
-        ProcXQueryDevicePointer,                /* 40 */
-        ProcXWarpDevicePointer,                 /* 41 */
-        ProcXChangeDeviceCursor,                /* 42 */
-        ProcXChangeDeviceHierarchy,             /* 43 */
-        ProcXSetClientPointer,                  /* 44 */
-        ProcXGetClientPointer,                  /* 45 */
-        ProcXiSelectEvent,                      /* 46 */
-        ProcXExtendedGrabDevice                 /* 47 */
+        ProcXGetDeviceProperty                  /* 39 */
 };
 
 /* For swapped clients */
@@ -264,15 +246,7 @@ static int (*SProcIVector[])(ClientPtr) = {
         SProcXListDeviceProperties,              /* 36 */
         SProcXChangeDeviceProperty,              /* 37 */
         SProcXDeleteDeviceProperty,              /* 38 */
-        SProcXGetDeviceProperty,                 /* 39 */
-        SProcXQueryDevicePointer,                /* 40 */
-        SProcXWarpDevicePointer,                 /* 41 */
-        SProcXChangeDeviceCursor,                /* 42 */
-        SProcXChangeDeviceHierarchy,             /* 43 */
-        SProcXSetClientPointer,                  /* 44 */
-        SProcXGetClientPointer,                  /* 45 */
-        SProcXiSelectEvent,                      /* 46 */
-        SProcXExtendedGrabDevice                 /* 47 */
+        SProcXGetDeviceProperty                  /* 39 */
 };
 
 /*****************************************************************
@@ -472,13 +446,6 @@ SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep)
         SRepXListDeviceProperties(client, len, (xListDevicePropertiesReply*)rep);
     else if (rep->RepType == X_GetDeviceProperty)
 	SRepXGetDeviceProperty(client, len, (xGetDevicePropertyReply *) rep);
-    else if (rep->RepType == X_QueryDevicePointer)
-	SRepXQueryDevicePointer(client, len,
-				(xQueryDevicePointerReply *) rep);
-    else if (rep->RepType == X_GetClientPointer)
-        SRepXGetClientPointer(client, len, (xGetClientPointerReply*) rep);
-    else if (rep->RepType == X_ExtendedGrabDevice)
-        SRepXExtendedGrabDevice(client, len, (xExtendedGrabDeviceReply*) rep);
     else {
 	FatalError("XINPUT confused sending swapped reply");
     }
diff --git a/Xi/getcptr.c b/Xi/getcptr.c
deleted file mode 100644
index ae45b13..0000000
--- a/Xi/getcptr.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright 2007-2008 Peter Hutterer
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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.
- *
- * Author: Peter Hutterer, University of South Australia, NICTA
- */
-
-#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 "getcptr.h"
-
-/***********************************************************************
- * This procedure allows a client to query another client's client pointer
- * setting.
- */
-
-int
-SProcXGetClientPointer(ClientPtr client)
-{
-    char n;
-    REQUEST(xGetClientPointerReq);
-
-    swaps(&stuff->length, n);
-    swapl(&stuff->win, n);
-    return ProcXGetClientPointer(client);
-}
-
-int ProcXGetClientPointer(ClientPtr client)
-{
-    int err;
-    WindowPtr win;
-    ClientPtr winclient;
-    xGetClientPointerReply rep;
-    REQUEST(xGetClientPointerReq);
-    REQUEST_SIZE_MATCH(xGetClientPointerReq);
-
-    err = dixLookupWindow(&win, stuff->win, client, DixReadAccess);
-    if (err != Success)
-    {
-        SendErrorToClient(client, IReqCode, X_GetClientPointer,
-                stuff->win, err);
-        return Success;
-    }
-
-    winclient = wClient(win);
-
-    rep.repType = X_Reply;
-    rep.RepType = X_GetClientPointer;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.set = (winclient->clientPtr != NULL);
-    rep.deviceid = (winclient->clientPtr) ? winclient->clientPtr->id : 0;
-
-    WriteReplyToClient(client, sizeof(xGetClientPointerReply), &rep);
-    return Success;
-}
-
-/***********************************************************************
- *
- * This procedure writes the reply for the XGetClientPointer function,
- * if the client and server have a different byte ordering.
- *
- */
-
-void
-SRepXGetClientPointer(ClientPtr client, int size,
-        xGetClientPointerReply* rep)
-{
-    char n;
-    swaps(&rep->sequenceNumber, n);
-    swapl(&rep->length, n);
-    WriteToClient(client, size, (char *)rep);
-}
-
diff --git a/Xi/getcptr.h b/Xi/getcptr.h
deleted file mode 100644
index 2745833..0000000
--- a/Xi/getcptr.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2007-2008 Peter Hutterer
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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.
- *
- * Author: Peter Hutterer, University of South Australia, NICTA
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#ifndef GETCPTR_H
-#define GETCPTR_H 1
-int SProcXGetClientPointer(ClientPtr /* client */
-        );
-
-int ProcXGetClientPointer(ClientPtr /* client */
-        );
-
-void SRepXGetClientPointer(ClientPtr /* client */,
-        int /* size */,
-        xGetClientPointerReply* /* rep */
-        );
-
-#endif /* GETCPTR_H */
diff --git a/Xi/querydp.c b/Xi/querydp.c
deleted file mode 100644
index 744a295..0000000
--- a/Xi/querydp.c
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright 2007-2008 Peter Hutterer
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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.
- *
- * Author: Peter Hutterer, University of South Australia, NICTA
- */
-
-/***********************************************************************
- *
- * Request to query the pointer location of an extension input 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 <X11/extensions/XI.h>
-#include <X11/extensions/XIproto.h>
-#include "extnsionst.h"
-#include "exevents.h"
-#include "exglobals.h"
-
-#ifdef PANORAMIX
-#include "panoramiXsrv.h"
-#endif
-
-#include "querydp.h"
-
-/***********************************************************************
- *
- * This procedure allows a client to query the pointer of a device.
- *
- */
-
-int
-SProcXQueryDevicePointer(ClientPtr client)
-{
-    char n;
-
-    REQUEST(xQueryDevicePointerReq);
-    swaps(&stuff->length, n);
-    return (ProcXQueryDevicePointer(client));
-}
-
-int
-ProcXQueryDevicePointer(ClientPtr client)
-{
-    int rc;
-    xQueryDevicePointerReply rep;
-    DeviceIntPtr pDev, kbd;
-    WindowPtr pWin, t;
-    SpritePtr pSprite;
-
-    REQUEST(xQueryDevicePointerReq);
-    REQUEST_SIZE_MATCH(xQueryDevicePointerReq);
-
-    rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixReadAccess);
-    if (rc != Success)
-        return rc;
-
-    if (pDev->valuator == NULL)
-    {
-        client->errorValue = stuff->deviceid;
-        return BadDevice;
-    }
-
-    rc = dixLookupWindow(&pWin, stuff->win, client, DixReadAccess);
-    if (rc != Success)
-    {
-        SendErrorToClient(client, IReqCode, X_QueryDevicePointer,
-                stuff->win, rc);
-        return Success;
-    }
-
-    if (pDev->valuator->motionHintWindow)
-        MaybeStopHint(pDev, client);
-
-    kbd = GetPairedDevice(pDev);
-
-    pSprite = pDev->spriteInfo->sprite;
-    rep.repType = X_Reply;
-    rep.RepType = X_QueryDevicePointer;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.mask = pDev->button->state | (kbd && kbd->key) ? kbd->key->state : 0;
-    rep.root = (GetCurrentRootWindow(pDev))->drawable.id;
-    rep.rootX = pSprite->hot.x;
-    rep.rootY = pSprite->hot.y;
-    rep.child = None;
-    rep.deviceid = pDev->id;
-
-    if (pSprite->hot.pScreen == pWin->drawable.pScreen)
-    {
-        rep.sameScreen = xTrue;
-        rep.winX = pSprite->hot.x - pWin->drawable.x;
-        rep.winY = pSprite->hot.y - pWin->drawable.y;
-        for (t = pSprite->win; t; t = t->parent)
-            if (t->parent == pWin)
-            {
-                rep.child = t->drawable.id;
-                break;
-            }
-    } else
-    {
-        rep.sameScreen = xFalse;
-        rep.winX = 0;
-        rep.winY = 0;
-    }
-
-#ifdef PANORAMIX
-    if(!noPanoramiXExtension) {
-        rep.rootX += panoramiXdataPtr[0].x;
-        rep.rootY += panoramiXdataPtr[0].y;
-        if (stuff->win == rep.root)
-        {
-            rep.winX += panoramiXdataPtr[0].x;
-            rep.winY += panoramiXdataPtr[0].y;
-        }
-    }
-#endif
-
-    WriteReplyToClient(client, sizeof(xQueryDevicePointerReply), &rep);
-    return Success;
-}
-
-/***********************************************************************
- *
- * This procedure writes the reply for the XQueryDevicePointer function,
- * if the client and server have a different byte ordering.
- *
- */
-
-void
-SRepXQueryDevicePointer(ClientPtr client, int size,
-        xQueryDevicePointerReply * rep)
-{
-    char n;
-
-    swaps(&rep->sequenceNumber, n);
-    swapl(&rep->length, n);
-    WriteToClient(client, size, (char *)rep);
-}
-
diff --git a/Xi/querydp.h b/Xi/querydp.h
deleted file mode 100644
index 5370ed4..0000000
--- a/Xi/querydp.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2007-2008 Peter Hutterer
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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.
- *
- * Author: Peter Hutterer, University of South Australia, NICTA
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#ifndef QUERYDP_H
-#define QUERYDP_H 1
-
-int SProcXQueryDevicePointer(ClientPtr	/* client */
-    );
-
-int ProcXQueryDevicePointer(ClientPtr	/* client */
-    );
-
-void SRepXQueryDevicePointer(ClientPtr /* client */ ,
-			   int /* size */ ,
-			   xQueryDevicePointerReply *	/* rep */
-    );
-
-#endif /* QUERYDP_H */
diff --git a/Xi/setcptr.c b/Xi/setcptr.c
deleted file mode 100644
index 81ce66b..0000000
--- a/Xi/setcptr.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright 2007-2008 Peter Hutterer
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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.
- *
- * Author: Peter Hutterer, University of South Australia, NICTA
- */
-
-/***********************************************************************
- *
- * Request to set the client pointer for the owner of the given window.
- * All subsequent calls that are ambiguous will choose the client pointer as
- * default value.
- */
-
-
-#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 "setcptr.h"
-
-int
-SProcXSetClientPointer(ClientPtr client)
-{
-    char n;
-
-    REQUEST(xSetClientPointerReq);
-    swaps(&stuff->length, n);
-    REQUEST_SIZE_MATCH(xSetClientPointerReq);
-    return (ProcXSetClientPointer(client));
-}
-
-int
-ProcXSetClientPointer(ClientPtr client)
-{
-    DeviceIntPtr pDev;
-    ClientPtr targetClient;
-    int rc;
-
-    REQUEST(xSetClientPointerReq);
-    REQUEST_SIZE_MATCH(xSetClientPointerReq);
-
-
-    rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixWriteAccess);
-    if (rc != Success)
-        return rc;
-
-    if (!IsPointerDevice(pDev) || !pDev->isMaster)
-    {
-        client->errorValue = stuff->deviceid;
-        return BadDevice;
-    }
-
-    if (stuff->win != None)
-    {
-        rc = dixLookupClient(&targetClient, stuff->win, client,
-                DixWriteAccess);
-
-        if (rc != Success)
-            return rc;
-
-    } else
-        targetClient = client;
-
-    if (!SetClientPointer(targetClient, client, pDev))
-    {
-        client->errorValue = stuff->win;
-        return BadAccess;
-    }
-
-    return Success;
-}
diff --git a/Xi/setcptr.h b/Xi/setcptr.h
deleted file mode 100644
index df38add..0000000
--- a/Xi/setcptr.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2007-2008 Peter Hutterer
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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.
- *
- * Author: Peter Hutterer, University of South Australia, NICTA
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#ifndef SETCPTR_H
-#define SETCPTR_H 1
-
-int SProcXSetClientPointer(ClientPtr /* client */);
-int ProcXSetClientPointer(ClientPtr /* client */);
-
-#endif /* SETCPTR_H */
diff --git a/Xi/warpdevp.c b/Xi/warpdevp.c
deleted file mode 100644
index c8e8d61..0000000
--- a/Xi/warpdevp.c
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Copyright 2007-2008 Peter Hutterer
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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.
- *
- * Author: Peter Hutterer, University of South Australia, NICTA
- */
-
-/***********************************************************************
- *
- * Request to Warp the pointer location of an extension input 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 "mipointer.h" /* for miPointerUpdateSprite */
-
-
-#include "warpdevp.h"
-/***********************************************************************
- *
- * This procedure allows a client to warp the pointer of a device.
- *
- */
-
-int
-SProcXWarpDevicePointer(ClientPtr client)
-{
-    char n;
-
-    REQUEST(xWarpDevicePointerReq);
-    swaps(&stuff->length, n);
-    return (ProcXWarpDevicePointer(client));
-}
-
-int
-ProcXWarpDevicePointer(ClientPtr client)
-{
-    int rc;
-    int x, y;
-    WindowPtr dest = NULL;
-    DeviceIntPtr pDev;
-    SpritePtr pSprite;
-    ScreenPtr newScreen;
-
-    REQUEST(xWarpDevicePointerReq);
-    REQUEST_SIZE_MATCH(xWarpDevicePointerReq);
-
-    /* FIXME: panoramix stuff is missing, look at ProcWarpPointer */
-
-    rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixWriteAccess);
-
-    if (rc != Success)
-        return rc;
-
-    if (stuff->dst_win != None)
-    {
-        rc = dixLookupWindow(&dest, stuff->dst_win, client, DixReadAccess);
-        if (rc != Success)
-        {
-            return rc;
-        }
-    }
-
-    pSprite = pDev->spriteInfo->sprite;
-    x = pSprite->hotPhys.x;
-    y = pSprite->hotPhys.y;
-
-    if (stuff->src_win != None)
-    {
-        int winX, winY;
-        WindowPtr src;
-
-        rc = dixLookupWindow(&src, stuff->src_win, client, DixReadAccess);
-        if (rc != Success)
-        {
-            return rc;
-        }
-
-        winX = src->drawable.x;
-        winY = src->drawable.y;
-        if (src->drawable.pScreen != pSprite->hotPhys.pScreen ||
-                x < winX + stuff->src_x ||
-                y < winY + stuff->src_y ||
-                (stuff->src_width != 0 &&
-                 winX + stuff->src_x + (int)stuff->src_width < 0) ||
-                (stuff->src_height != 0 &&
-                 winY + stuff->src_y + (int)stuff->src_height < y) ||
-                !PointInWindowIsVisible(src, x, y))
-            return Success;
-    }
-
-    if (dest)
-    {
-        x = dest->drawable.x;
-        y = dest->drawable.y;
-        newScreen = dest->drawable.pScreen;
-    } else
-        newScreen = pSprite->hotPhys.pScreen;
-
-    x += stuff->dst_x;
-    y += stuff->dst_y;
-
-    if (x < 0)
-        x = 0;
-    else if (x > newScreen->width)
-        x = newScreen->width - 1;
-
-    if (y < 0)
-        y = 0;
-    else if (y > newScreen->height)
-        y = newScreen->height - 1;
-
-    if (newScreen == pSprite->hotPhys.pScreen)
-    {
-        if (x < pSprite->physLimits.x1)
-            x = pSprite->physLimits.x1;
-        else if (x >= pSprite->physLimits.x2)
-            x = pSprite->physLimits.x2 - 1;
-
-        if (y < pSprite->physLimits.y1)
-            y = pSprite->physLimits.y1;
-        else if (y >= pSprite->physLimits.y2)
-            y = pSprite->physLimits.y2 - 1;
-
-        if (pSprite->hotShape)
-            ConfineToShape(pDev, pSprite->hotShape, &x, &y);
-        (*newScreen->SetCursorPosition)(pDev, newScreen, x, y, TRUE);
-    } else if (!PointerConfinedToScreen(pDev))
-    {
-        NewCurrentScreen(pDev, newScreen, x, y);
-    }
-
-    /* if we don't update the device, we get a jump next time it moves */
-    pDev->last.valuators[0] = x;
-    pDev->last.valuators[1] = x;
-    miPointerUpdateSprite(pDev);
-
-    /* FIXME: XWarpPointer is supposed to generate an event. It doesn't do it
-       here though. */
-    return Success;
-}
-
diff --git a/Xi/warpdevp.h b/Xi/warpdevp.h
deleted file mode 100644
index 00a4dff..0000000
--- a/Xi/warpdevp.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright 2007-2008 Peter Hutterer
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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.
- *
- * Author: Peter Hutterer, University of South Australia, NICTA
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#ifndef WARPDEVP_H
-#define WARPDEVP_H 1
-
-int SProcXWarpDevicePointer(ClientPtr	/* client */
-    );
-
-int ProcXWarpDevicePointer(ClientPtr	/* client */
-    );
-
-#endif /* WARPDEVP_H */
diff --git a/Xi/xiselev.c b/Xi/xiselev.c
deleted file mode 100644
index 0f84334..0000000
--- a/Xi/xiselev.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright 2007-2008 Peter Hutterer
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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.
- *
- * Author: Peter Hutterer, University of South Australia, NICTA
- */
-
-#define	 NEED_EVENTS
-#define	 NEED_REPLIES
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include <X11/extensions/XIproto.h>
-
-#include "dixstruct.h"
-#include "windowstr.h"
-
-#include "exglobals.h"
-#include "xiselev.h"
-#include "geext.h"
-
-int
-SProcXiSelectEvent(ClientPtr client)
-{
-    char n;
-
-    REQUEST(xXiSelectEventReq);
-    swaps(&stuff->length, n);
-    REQUEST_SIZE_MATCH(xXiSelectEventReq);
-    swapl(&stuff->window, n);
-    swapl(&stuff->mask, n);
-    return (ProcXiSelectEvent(client));
-}
-
-
-int
-ProcXiSelectEvent(ClientPtr client)
-{
-    int rc;
-    WindowPtr pWin;
-    DeviceIntPtr pDev;
-    REQUEST(xXiSelectEventReq);
-    REQUEST_SIZE_MATCH(xXiSelectEventReq);
-
-    rc = dixLookupWindow(&pWin, stuff->window, client, DixReceiveAccess);
-    if (rc != Success)
-        return rc;
-
-    if (stuff->deviceid & (0x1 << 7)) /* all devices */
-        pDev = NULL;
-    else {
-        rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixReadAccess);
-        if (rc != Success)
-            return rc;
-    }
-
-    GEWindowSetMask(client, pDev, pWin, IReqCode, stuff->mask);
-
-    return Success;
-}
-
diff --git a/Xi/xiselev.h b/Xi/xiselev.h
deleted file mode 100644
index b751c5d..0000000
--- a/Xi/xiselev.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright 2007-2008 Peter Hutterer
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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.
- *
- * Author: Peter Hutterer, University of South Australia, NICTA
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#ifndef XISELEV_H
-#define XISELEV_H 1
-
-int SProcXiSelectEvent(ClientPtr /* client */
-    );
-
-int ProcXiSelectEvent(ClientPtr	/* client */
-    );
-
-#endif /* XISELEV_H */
-


More information about the xorg-commit mailing list