xserver: Branch 'master' - 16 commits

Peter Hutterer whot at kemper.freedesktop.org
Wed Jul 29 18:07:51 PDT 2009


 Xi/exevents.c                  |    9 +
 Xi/grabdev.c                   |    2 
 Xi/listdev.c                   |    1 
 dix/devices.c                  |    1 
 dix/enterleave.c               |   34 +++--
 dix/enterleave.h               |    2 
 dix/eventconvert.c             |   13 +-
 dix/events.c                   |   27 ++--
 dix/getevents.c                |   14 +-
 hw/kdrive/src/kinput.c         |    1 
 hw/xfree86/common/xf86DGA.c    |    2 
 hw/xfree86/common/xf86Xinput.c |  135 +++++++++++++----------
 hw/xfree86/common/xf86Xinput.h |   16 ++
 include/Makefile.am            |    2 
 include/events.h               |  210 ------------------------------------
 include/eventstr.h             |  236 +++++++++++++++++++++++++++++++++++++++++
 include/exevents.h             |    2 
 include/input.h                |    3 
 include/xkbsrv.h               |    5 
 mi/mi.h                        |    2 
 mi/mieq.c                      |   38 +-----
 record/record.c                |   18 ++-
 xkb/ddxDevBtn.c                |  107 ++++--------------
 xkb/xkb.h                      |    2 
 xkb/xkbAccessX.c               |    1 
 xkb/xkbActions.c               |    1 
 xkb/xkbPrKeyEv.c               |    1 
 xkb/xkbUtils.c                 |    1 
 28 files changed, 459 insertions(+), 427 deletions(-)

New commits:
commit 0565f4ed4519962bed40a0bbcf0b409471f4de40
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Jul 29 16:46:45 2009 +1000

    Xi: set the sourceid for focus devices to the device id.
    
    Unlike Enter/Leave events generated by a device pushing the pointer around,
    a device doesn't change focus all by itself. It's a result of a
    SetInputFocus call, a window becoming unviewable or a grab activating. As
    such, the sourceid for focus events is always the deviceid itself.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xi/exevents.c b/Xi/exevents.c
index 4773c49..85d14b0 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1273,7 +1273,7 @@ DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail,
     xi2event->detail       = detail;
     xi2event->time         = currentTime.milliseconds;
     xi2event->deviceid     = dev->id;
-    xi2event->sourceid     = 0; /*XXX */
+    xi2event->sourceid     = dev->id; /* a device doesn't change focus by itself */
     xi2event->mode         = mode;
     xi2event->root_x       = FP1616(mouse->spriteInfo->sprite->hot.x, 0);
     xi2event->root_y       = FP1616(mouse->spriteInfo->sprite->hot.y, 0);
commit de4dd5848cab90b0f8b8243ca0b49985ef047124
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Jul 29 16:45:34 2009 +1000

    include: DeviceFocusEvent is not to be exported.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/include/exevents.h b/include/exevents.h
index 861d0dd..f58488d 100644
--- a/include/exevents.h
+++ b/include/exevents.h
@@ -80,7 +80,7 @@ extern _X_EXPORT void InitValuatorAxisStruct(
 	int                    /* min_res */,
 	int                    /* max_res */);
 
-extern _X_EXPORT void DeviceFocusEvent(
+extern void DeviceFocusEvent(
 	DeviceIntPtr           /* dev */,
 	int                    /* type */,
 	int                    /* mode */,
commit 46ac9f92416f3cb99b5d84a9d200237dc33a3bb7
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Jul 29 16:34:28 2009 +1000

    dix: pass the sourceid around for enter/leave events.
    
    The sourceid for enter/leave events as a result of pointer motion is the ID
    of the slave device. The sourceid for those as a result of a grab activating
    is the device itself.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/enterleave.c b/dix/enterleave.c
index a476f8f..09b9f55 100644
--- a/dix/enterleave.c
+++ b/dix/enterleave.c
@@ -218,6 +218,7 @@ CommonAncestor(
  */
 static void
 DeviceEnterNotifies(DeviceIntPtr dev,
+              int sourceid,
               WindowPtr ancestor,
               WindowPtr child,
               int mode,
@@ -227,8 +228,8 @@ DeviceEnterNotifies(DeviceIntPtr dev,
 
     if (ancestor == parent)
 	return;
-    DeviceEnterNotifies(dev, ancestor, parent, mode, detail);
-    DeviceEnterLeaveEvent(dev, XI_Enter, mode, detail, parent,
+    DeviceEnterNotifies(dev, sourceid, ancestor, parent, mode, detail);
+    DeviceEnterLeaveEvent(dev, sourceid, XI_Enter, mode, detail, parent,
                           child->drawable.id);
 }
 
@@ -323,6 +324,7 @@ CoreLeaveNotifies(DeviceIntPtr dev,
  */
 static void
 DeviceLeaveNotifies(DeviceIntPtr dev,
+              int sourceid,
               WindowPtr child,
               WindowPtr ancestor,
               int mode,
@@ -334,7 +336,7 @@ DeviceLeaveNotifies(DeviceIntPtr dev,
 	return;
     for (win = child->parent; win != ancestor; win = win->parent)
     {
-        DeviceEnterLeaveEvent(dev, XI_Leave, mode, detail, win,
+        DeviceEnterLeaveEvent(dev, sourceid, XI_Leave, mode, detail, win,
                                   child->drawable.id);
         child = win;
     }
@@ -562,30 +564,31 @@ CoreEnterLeaveEvents(DeviceIntPtr dev,
 
 static void
 DeviceEnterLeaveEvents(DeviceIntPtr dev,
+                       int          sourceid,
                        WindowPtr    from,
                        WindowPtr    to,
                        int          mode)
 {
     if (IsParent(from, to))
     {
-        DeviceEnterLeaveEvent(dev, XI_Leave, mode, NotifyInferior, from, None);
-        DeviceEnterNotifies(dev, from, to, mode, NotifyVirtual);
-        DeviceEnterLeaveEvent(dev, XI_Enter, mode, NotifyAncestor, to, None);
+        DeviceEnterLeaveEvent(dev, sourceid, XI_Leave, mode, NotifyInferior, from, None);
+        DeviceEnterNotifies(dev, sourceid, from, to, mode, NotifyVirtual);
+        DeviceEnterLeaveEvent(dev, sourceid, XI_Enter, mode, NotifyAncestor, to, None);
     }
     else if (IsParent(to, from))
     {
-	DeviceEnterLeaveEvent(dev, XI_Leave, mode, NotifyAncestor, from, None);
-	DeviceLeaveNotifies(dev, from, to, mode, NotifyVirtual);
-	DeviceEnterLeaveEvent(dev, XI_Enter, mode, NotifyInferior, to, None);
+	DeviceEnterLeaveEvent(dev, sourceid, XI_Leave, mode, NotifyAncestor, from, None);
+	DeviceLeaveNotifies(dev, sourceid, from, to, mode, NotifyVirtual);
+	DeviceEnterLeaveEvent(dev, sourceid, XI_Enter, 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, XI_Leave, mode, NotifyNonlinear, from, None);
-        DeviceLeaveNotifies(dev, from, common, mode, NotifyNonlinearVirtual);
-        DeviceEnterNotifies(dev, common, to, mode, NotifyNonlinearVirtual);
-        DeviceEnterLeaveEvent(dev, XI_Enter, mode, NotifyNonlinear, to, None);
+        DeviceEnterLeaveEvent(dev, sourceid, XI_Leave, mode, NotifyNonlinear, from, None);
+        DeviceLeaveNotifies(dev, sourceid, from, common, mode, NotifyNonlinearVirtual);
+        DeviceEnterNotifies(dev, sourceid, common, to, mode, NotifyNonlinearVirtual);
+        DeviceEnterLeaveEvent(dev, sourceid, XI_Enter, mode, NotifyNonlinear, to, None);
     }
 }
 
@@ -598,6 +601,7 @@ DeviceEnterLeaveEvents(DeviceIntPtr dev,
  */
 void
 DoEnterLeaveEvents(DeviceIntPtr pDev,
+        int sourceid,
         WindowPtr fromWin,
         WindowPtr toWin,
         int mode)
@@ -610,7 +614,7 @@ DoEnterLeaveEvents(DeviceIntPtr pDev,
 
     if (mode != XINotifyPassiveGrab && mode != XINotifyPassiveUngrab)
         CoreEnterLeaveEvents(pDev, fromWin, toWin, mode);
-    DeviceEnterLeaveEvents(pDev, fromWin, toWin, mode);
+    DeviceEnterLeaveEvents(pDev, sourceid, fromWin, toWin, mode);
 }
 
 /**
diff --git a/dix/enterleave.h b/dix/enterleave.h
index edca386..746c5d4 100644
--- a/dix/enterleave.h
+++ b/dix/enterleave.h
@@ -33,6 +33,7 @@
 
 extern void DoEnterLeaveEvents(
     DeviceIntPtr pDev,
+    int sourceid,
     WindowPtr fromWin,
     WindowPtr toWin,
     int mode
@@ -64,6 +65,7 @@ extern void CoreEnterLeaveEvent(DeviceIntPtr mouse,
                                 WindowPtr pWin,
                                 Window child);
 extern void DeviceEnterLeaveEvent(DeviceIntPtr mouse,
+                                  int sourceid,
                                   int type,
                                   int mode,
                                   int detail,
diff --git a/dix/events.c b/dix/events.c
index 5aef03e..de8d559 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1474,7 +1474,7 @@ ActivatePointerGrab(DeviceIntPtr mouse, GrabPtr grab,
                 mouse->spriteInfo->sprite->hotPhys.y = 0;
 	ConfineCursorToWindow(mouse, grab->confineTo, FALSE, TRUE);
     }
-    DoEnterLeaveEvents(mouse, oldWin, grab->window, NotifyGrab);
+    DoEnterLeaveEvents(mouse, mouse->id, oldWin, grab->window, NotifyGrab);
     mouse->valuator->motionHintWindow = NullWindow;
     if (syncEvents.playingEvents)
         grabinfo->grabTime = syncEvents.time;
@@ -1511,7 +1511,7 @@ DeactivatePointerGrab(DeviceIntPtr mouse)
 	if (dev->deviceGrab.sync.other == grab)
 	    dev->deviceGrab.sync.other = NullGrab;
     }
-    DoEnterLeaveEvents(mouse, grab->window,
+    DoEnterLeaveEvents(mouse, mouse->id, grab->window,
                        mouse->spriteInfo->sprite->win, NotifyUngrab);
     if (grab->confineTo)
 	ConfineCursorToWindow(mouse, RootWindow(mouse), FALSE, FALSE);
@@ -2585,7 +2585,7 @@ ActivateFocusInGrab(DeviceIntPtr dev, WindowPtr old, WindowPtr win)
         if (dev->deviceGrab.grab->window == win ||
             IsParent(dev->deviceGrab.grab->window, win))
             return FALSE;
-        DoEnterLeaveEvents(dev, old, win, XINotifyPassiveUngrab);
+        DoEnterLeaveEvents(dev, dev->id, old, win, XINotifyPassiveUngrab);
         (*dev->deviceGrab.DeactivateGrab)(dev);
     }
 
@@ -2602,7 +2602,7 @@ ActivateFocusInGrab(DeviceIntPtr dev, WindowPtr old, WindowPtr win)
     event.detail.button = 0;
     rc = CheckPassiveGrabsOnWindow(win, dev, &event, FALSE);
     if (rc)
-        DoEnterLeaveEvents(dev, old, win, XINotifyPassiveUngrab);
+        DoEnterLeaveEvents(dev, dev->id, old, win, XINotifyPassiveUngrab);
     return rc;
 }
 
@@ -2625,7 +2625,7 @@ ActivateEnterGrab(DeviceIntPtr dev, WindowPtr old, WindowPtr win)
         if (dev->deviceGrab.grab->window == win ||
             IsParent(dev->deviceGrab.grab->window, win))
             return FALSE;
-        DoEnterLeaveEvents(dev, old, win, XINotifyPassiveUngrab);
+        DoEnterLeaveEvents(dev, dev->id, old, win, XINotifyPassiveUngrab);
         (*dev->deviceGrab.DeactivateGrab)(dev);
     }
 
@@ -2639,7 +2639,7 @@ ActivateEnterGrab(DeviceIntPtr dev, WindowPtr old, WindowPtr win)
     event.detail.button = 0;
     rc = CheckPassiveGrabsOnWindow(win, dev, &event, FALSE);
     if (rc)
-        DoEnterLeaveEvents(dev, old, win, XINotifyPassiveGrab);
+        DoEnterLeaveEvents(dev, dev->id, old, win, XINotifyPassiveGrab);
 
     return rc;
 }
@@ -2740,12 +2740,16 @@ CheckMotion(DeviceEvent *ev, DeviceIntPtr pDev)
 
     if (newSpriteWin != prevSpriteWin)
     {
-        if (!ev)
+        int sourceid;
+        if (!ev) {
             UpdateCurrentTimeIf();
+            sourceid = pDev->id; /* when from WindowsRestructured */
+        } else
+            sourceid = ev->sourceid;
 
 	if (prevSpriteWin != NullWindow) {
             if (!ActivateEnterGrab(pDev, prevSpriteWin, newSpriteWin))
-                DoEnterLeaveEvents(pDev, prevSpriteWin,
+                DoEnterLeaveEvents(pDev, sourceid, prevSpriteWin,
                                    newSpriteWin, NotifyNormal);
         }
         /* set pSprite->win after ActivateEnterGrab, otherwise
@@ -4216,6 +4220,7 @@ CoreEnterLeaveEvent(
 void
 DeviceEnterLeaveEvent(
     DeviceIntPtr mouse,
+    int sourceid,
     int type,
     int mode,
     int detail,
@@ -4245,7 +4250,7 @@ DeviceEnterLeaveEvent(
     event->detail       = detail;
     event->time         = currentTime.milliseconds;
     event->deviceid     = mouse->id;
-    event->sourceid     = 0; /*XXX */
+    event->sourceid     = sourceid;
     event->mode         = mode;
     event->root_x       = FP1616(mouse->spriteInfo->sprite->hot.x, 0);
     event->root_y       = FP1616(mouse->spriteInfo->sprite->hot.y, 0);
commit c299b2228fb63c192b72851c90e14ceaceb67bbc
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Jul 29 16:00:19 2009 +1000

    dix: remove obsolete comment, parameter described doesn't exist.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/enterleave.c b/dix/enterleave.c
index 488a943..a476f8f 100644
--- a/dix/enterleave.c
+++ b/dix/enterleave.c
@@ -215,8 +215,6 @@ CommonAncestor(
  * Send enter notifies to all windows between 'ancestor' and 'child' (excluding
  * both). Events are sent running up the window hierarchy. This function
  * recurses.
- *
- * @param core If TRUE, core events are sent, otherwise XI events will be sent.
  */
 static void
 DeviceEnterNotifies(DeviceIntPtr dev,
commit 5085ac09a50721d87196bd9f2607dc76200ca399
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Jul 29 13:45:32 2009 +1000

    input: switch internal event types to enums.
    
    Use enum EventType instead of ints. This requires a load of default
    cases in various switch statements to silence compiler warnings.
    
    Reported-by: Aaron Plattner
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xi/exevents.c b/Xi/exevents.c
index 5c43266..4773c49 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -131,6 +131,8 @@ IsPointerEvent(InternalEvent* event)
         case ET_Motion:
             /* XXX: enter/leave ?? */
             return TRUE;
+        default:
+            break;
     }
     return FALSE;
 }
@@ -1066,6 +1068,8 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device)
             event->corestate = state;
             key = event->detail.key;
             break;
+        default:
+            break;
     }
 
 #if 0
@@ -1120,6 +1124,8 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device)
                  device->deviceGrab.grab->type == DeviceButtonPress ||
                  device->deviceGrab.grab->type == XI_ButtonPress))
                 deactivateDeviceGrab = TRUE;
+        default:
+            break;
     }
 
 
diff --git a/dix/eventconvert.c b/dix/eventconvert.c
index 943178e..866fa29 100644
--- a/dix/eventconvert.c
+++ b/dix/eventconvert.c
@@ -147,6 +147,8 @@ EventToXI(InternalEvent *ev, xEvent **xi, int *count)
             *count = 0;
             *xi = NULL;
             return BadMatch;
+        default:
+            break;
     }
 
     ErrorF("[dix] EventToXI: Not implemented for %d \n", ev->any.type);
@@ -196,7 +198,8 @@ EventToXI2(InternalEvent *ev, xEvent **xi)
         case ET_RawButtonRelease:
         case ET_RawMotion:
             return eventToRawEvent((RawDeviceEvent*)ev, xi);
-
+        default:
+            break;
     }
 
     ErrorF("[dix] EventToXI2: Not implemented for %d \n", ev->any.type);
@@ -247,6 +250,8 @@ eventToKeyButtonPointer(DeviceEvent *ev, xEvent **xi, int *count)
         case ET_KeyRelease:    kbp->type = DeviceKeyRelease;    break;
         case ET_ProximityIn:   kbp->type = ProximityIn;         break;
         case ET_ProximityOut:  kbp->type = ProximityOut;        break;
+        default:
+            break;
     }
 
     if (num_events > 1)
@@ -518,6 +523,8 @@ GetCoreType(InternalEvent *event)
         case ET_ButtonRelease:  coretype = ButtonRelease; break;
         case ET_KeyPress:       coretype = KeyPress;      break;
         case ET_KeyRelease:     coretype = KeyRelease;    break;
+        default:
+            break;
     }
     return coretype;
 }
@@ -539,6 +546,8 @@ GetXIType(InternalEvent *event)
         case ET_KeyRelease:     xitype = DeviceKeyRelease;    break;
         case ET_ProximityIn:    xitype = ProximityIn;         break;
         case ET_ProximityOut:   xitype = ProximityOut;        break;
+        default:
+            break;
     }
     return xitype;
 }
diff --git a/include/eventstr.h b/include/eventstr.h
index e39beb9..06a57e3 100644
--- a/include/eventstr.h
+++ b/include/eventstr.h
@@ -83,7 +83,7 @@ enum EventType {
 struct _DeviceEvent
 {
     unsigned char header; /**< Always ET_Internal */
-    int type;             /**< One of EventType */
+    enum EventType type;  /**< One of EventType */
     int length;           /**< Length in bytes */
     Time time;            /**< Time in ms */
     int deviceid;         /**< Device to post this event for */
@@ -136,7 +136,7 @@ struct _DeviceEvent
 struct _DeviceChangedEvent
 {
     unsigned char header; /**< Always ET_Internal */
-    int type;             /**< ET_DeviceChanged */
+    enum EventType type;  /**< ET_DeviceChanged */
     int length;           /**< Length in bytes */
     Time time;            /**< Time in ms */
     int deviceid;         /**< Device whose capabilities have changed */
@@ -177,7 +177,7 @@ struct _DeviceChangedEvent
 struct _DGAEvent
 {
     unsigned char header; /**<  Always ET_Internal */
-    int type;             /**<  ET_DGAEvent */
+    enum EventType type;  /**<  ET_DGAEvent */
     int length;           /**<  Length in bytes */
     Time time;            /**<  Time in ms */
     int subtype;          /**<  KeyPress, KeyRelease, ButtonPress,
@@ -196,7 +196,7 @@ struct _DGAEvent
 struct _RawDeviceEvent
 {
     unsigned char header; /**<  Always ET_Internal */
-    int type;             /**<  ET_Raw */
+    enum EventType type;  /**<  ET_Raw */
     int length;           /**<  Length in bytes */
     Time time;            /**<  Time in ms */
     int deviceid;         /**< Device to post this event for */
@@ -221,7 +221,7 @@ struct _RawDeviceEvent
 union _InternalEvent {
         struct {
             unsigned char header; /**< Always ET_Internal */
-            int type;             /**< One of ET_* */
+            enum EventType type;  /**< One of ET_* */
             int length;           /**< Length in bytes */
             Time time;            /**< Time in ms. */
         } any;
commit 1ae8332d643299a3ee9a9f45a8e25b8c87c751e1
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Jul 29 13:39:38 2009 +1000

    include: fix enum EventType declaration.
    
    Having EventType after the enum declares a variable. silly me.
    
    Reported-by: Aaron Plattner
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/include/eventstr.h b/include/eventstr.h
index 3eefc05..e39beb9 100644
--- a/include/eventstr.h
+++ b/include/eventstr.h
@@ -44,7 +44,7 @@
  * Note: Keep KeyPress to Motion aligned with the core events.
  *       Keep ET_Raw* in the same order as KeyPress - Motion
  */
-enum {
+enum EventType {
     ET_KeyPress = 2,
     ET_KeyRelease,
     ET_ButtonPress,
@@ -67,7 +67,7 @@ enum {
     ET_RawButtonRelease,
     ET_RawMotion,
     ET_Internal = 0xFF /* First byte */
-} EventType;
+};
 
 #define CHECKEVENT(ev) if (ev && ((InternalEvent*)(ev))->any.header != 0xFF) \
                           FatalError("Wrong event type %d.\n", \
commit 994f7a1c814a89e90f710dac5bf6b2445fb64712
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Jul 29 12:11:13 2009 +1000

    record: silence some compiler warnings.
    
    warning: passing argument 4 of ‘RecordAProtocolElement’ discards qualifiers
    from pointer target type
    note: expected ‘pointer’ but argument is of type ‘const void *’
    
    record.c:2745: warning: passing argument 1 of ‘SwapConnSetupInfo’ from
    incompatible pointer type
    ../include/swaprep.h:243: note: expected ‘char *’ but argument is of type
    ‘struct xConnSetup *’
    
    record.c:2745: warning: passing argument 1 of ‘SwapConnSetupInfo’ from
    incompatible pointer type
    ../include/swaprep.h:243: note: expected ‘char *’ but argument is of type
    ‘struct xConnSetup *’
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/record/record.c b/record/record.c
index effb926..7000b00 100644
--- a/record/record.c
+++ b/record/record.c
@@ -614,7 +614,7 @@ RecordAReply(CallbackListPtr *pcbl, pointer nulldata, pointer calldata)
 	    if (pContext->continuedReply)
 	    {
 		RecordAProtocolElement(pContext, client, XRecordFromServer,
-		    pri->replyData, pri->dataLenBytes, /* continuation */ -1);
+		   (pointer)pri->replyData, pri->dataLenBytes, /* continuation */ -1);
 		if (!pri->bytesRemaining)
 		    pContext->continuedReply = 0;
 	    }
@@ -624,7 +624,7 @@ RecordAReply(CallbackListPtr *pcbl, pointer nulldata, pointer calldata)
 		if (majorop <= 127)
 		{ /* core reply */
 		    RecordAProtocolElement(pContext, client, XRecordFromServer,
-		       pri->replyData, pri->dataLenBytes, pri->bytesRemaining);
+		       (pointer)pri->replyData, pri->dataLenBytes, pri->bytesRemaining);
 		    if (pri->bytesRemaining)
 			pContext->continuedReply = 1;
 		}
@@ -645,7 +645,7 @@ RecordAReply(CallbackListPtr *pcbl, pointer nulldata, pointer calldata)
 						minorop))
 			{
 			    RecordAProtocolElement(pContext, client, 
-				XRecordFromServer, pri->replyData,
+				XRecordFromServer, (pointer)pri->replyData,
 				pri->dataLenBytes, pri->bytesRemaining);
 			    if (pri->bytesRemaining)
 				pContext->continuedReply = 1;
@@ -2741,8 +2741,8 @@ RecordConnectionSetupInfo(RecordContextPtr pContext, NewClientInfoRec *pci)
 	char *pConnSetup = (char *)xalloc(prefixsize + restsize);
 	if (!pConnSetup)
 	    return;
-	SwapConnSetupPrefix(pci->prefix, pConnSetup);
-	SwapConnSetupInfo(pci->setup, pConnSetup + prefixsize);
+	SwapConnSetupPrefix(pci->prefix, (xConnSetupPrefix*)pConnSetup);
+	SwapConnSetupInfo((char*)pci->setup, (char*)(pConnSetup + prefixsize));
 	RecordAProtocolElement(pContext, pci->client, XRecordClientStarted,
 			       (pointer)pConnSetup, prefixsize + restsize, 0);
 	xfree(pConnSetup);
commit a863d636293cd7361639c1a8cf9c4f7f15da1e1d
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Jul 29 12:09:34 2009 +1000

    Xi: remove FIXME and obsolete include.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xi/listdev.c b/Xi/listdev.c
index 563fc07..98ef7aa 100644
--- a/Xi/listdev.c
+++ b/Xi/listdev.c
@@ -61,7 +61,6 @@ SOFTWARE.
 #include <X11/extensions/XIproto.h>
 #include "XIstubs.h"
 #include "extnsionst.h"
-#include "exglobals.h"	/* FIXME */
 #include "exevents.h"
 #include "xace.h"
 #include "xkbsrv.h"
commit fac49df08f173f091cbb77feaf373d7d465358af
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Jul 29 12:07:22 2009 +1000

    Xi: remove obsolete comment.
    
    XI1 only uses 7 bits for deviceids, bit 8 is used for the MORE_EVENTS flag
    on the wire (when DeviceValuator events are required).
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xi/grabdev.c b/Xi/grabdev.c
index a7e46fe..925c9a6 100644
--- a/Xi/grabdev.c
+++ b/Xi/grabdev.c
@@ -181,7 +181,7 @@ CreateMaskFromList(ClientPtr client, XEventClass * list, int count,
 
     for (i = 0; i < count; i++, list++) {
 	device = *list >> 8;
-	if (device > 255) /* FIXME: we only use 7 bit for devices? */
+	if (device > 255)
 	    return BadClass;
 
 	rc = dixLookupDevice(&tdev, device, client, DixUseAccess);
commit 845e65f08059e8f4bfd37356e99b48bba9416c0c
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Jul 29 11:54:14 2009 +1000

    xkb: move XkbFilterEvents to xkbsrv.h
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/events.c b/dix/events.c
index a6a1075..5aef03e 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -134,9 +134,6 @@ of the copyright holder.
 
 #include <X11/extensions/XKBproto.h>
 #include "xkbsrv.h"
-/* XKB FIXME: why is this here? */
-extern Bool XkbFilterEvents(ClientPtr, int, xEvent *);
-
 #include "xace.h"
 
 #ifdef XSERVER_DTRACE
diff --git a/include/xkbsrv.h b/include/xkbsrv.h
index 1c4378a..31467e9 100644
--- a/include/xkbsrv.h
+++ b/include/xkbsrv.h
@@ -946,6 +946,11 @@ extern int XkbGetKeysym(
         DeviceIntPtr            /* dev */,
         DeviceEvent*            /* event*/);
 
+extern Bool XkbFilterEvents(
+        ClientPtr               /* pClient */,
+        int                     /* nEvents */,
+        xEvent*                 /* xE */);
+
 #include "xkbfile.h"
 #include "xkbrules.h"
 
diff --git a/xkb/xkb.h b/xkb/xkb.h
index 45d9b3d..a526356 100644
--- a/xkb/xkb.h
+++ b/xkb/xkb.h
@@ -29,6 +29,4 @@ extern int ProcXkbSetDeviceInfo(ClientPtr client);
 extern int ProcXkbSetDebuggingFlags(ClientPtr client);
 
 extern void XkbExtensionInit(void);
-
-extern Bool XkbFilterEvents(ClientPtr pClient, int nEvents, xEvent *xE);
 #endif
commit 8da0ff2d51086666d10ca7330d428e8610a4a0e3
Author: Oliver McFadden <oliver.mcfadden at nokia.com>
Date:   Tue Jul 28 08:20:37 2009 +0300

    xf86Xinput: Add the xf86Post(Proximity|Button|Key)EventP helper functions.
    
    xf86PostKeyboardEvent also makes use of xf86PostKeyEventP to avoid code
    duplication, and the valuator verification has been split into the
    XI_VERIFY_VALUATORS macro.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 7b5904e..210f5bf 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -713,11 +713,7 @@ xf86PostMotionEvent(DeviceIntPtr	device,
     int i = 0;
     static int valuators[MAX_VALUATORS];
 
-    if (num_valuators > MAX_VALUATORS) {
-	xf86Msg(X_ERROR, "%s: num_valuator %d is greater than"
-	    " MAX_VALUATORS\n", __FUNCTION__, num_valuators);
-	return;
-    }
+    XI_VERIFY_VALUATORS(num_valuators);
 
     va_start(var, num_valuators);
     for (i = 0; i < num_valuators; i++)
@@ -741,11 +737,7 @@ xf86PostMotionEventP(DeviceIntPtr	device,
     int index;
     int flags = 0;
 
-    if (num_valuators > MAX_VALUATORS) {
-	xf86Msg(X_ERROR, "%s: num_valuator %d is greater than"
-	    " MAX_VALUATORS\n", __FUNCTION__, num_valuators);
-	return;
-    }
+    XI_VERIFY_VALUATORS(num_valuators);
 
     if (is_absolute)
         flags = POINTER_ABSOLUTE;
@@ -801,21 +793,32 @@ xf86PostProximityEvent(DeviceIntPtr	device,
                        ...)
 {
     va_list var;
-    int i, nevents;
+    int i;
     int valuators[MAX_VALUATORS];
 
-
-    if (num_valuators > MAX_VALUATORS) {
-	xf86Msg(X_ERROR, "%s: num_valuator %d is greater than"
-	    " MAX_VALUATORS\n", __FUNCTION__, num_valuators);
-	return;
-    }
+    XI_VERIFY_VALUATORS(num_valuators);
 
     va_start(var, num_valuators);
     for (i = 0; i < num_valuators; i++)
         valuators[i] = va_arg(var, int);
     va_end(var);
 
+    xf86PostProximityEventP(device, is_in, first_valuator, num_valuators,
+			    valuators);
+
+}
+
+void
+xf86PostProximityEventP(DeviceIntPtr	device,
+                        int		is_in,
+                        int		first_valuator,
+                        int		num_valuators,
+                        int		*valuators)
+{
+    int i, nevents;
+
+    XI_VERIFY_VALUATORS(num_valuators);
+
     GetEventList(&xf86Events);
     nevents = GetProximityEvents(xf86Events, device,
                                  is_in ? ProximityIn : ProximityOut, 
@@ -836,6 +839,29 @@ xf86PostButtonEvent(DeviceIntPtr	device,
 {
     va_list var;
     int valuators[MAX_VALUATORS];
+    int i = 0;
+
+    XI_VERIFY_VALUATORS(num_valuators);
+
+    va_start(var, num_valuators);
+    for (i = 0; i < num_valuators; i++)
+        valuators[i] = va_arg(var, int);
+    va_end(var);
+
+    xf86PostButtonEventP(device, is_absolute, button, is_down, first_valuator,
+			 num_valuators, valuators);
+
+}
+
+void
+xf86PostButtonEventP(DeviceIntPtr	device,
+                     int		is_absolute,
+                     int		button,
+                     int		is_down,
+                     int		first_valuator,
+                     int		num_valuators,
+                     int		*valuators)
+{
     int i = 0, nevents = 0;
     int index;
 
@@ -846,16 +872,8 @@ xf86PostButtonEvent(DeviceIntPtr	device,
             return;
     }
 #endif
-    if (num_valuators > MAX_VALUATORS) {
-	xf86Msg(X_ERROR, "%s: num_valuator %d is greater than"
-	    " MAX_VALUATORS\n", __FUNCTION__, num_valuators);
-	return;
-    }
 
-    va_start(var, num_valuators);
-    for (i = 0; i < num_valuators; i++)
-        valuators[i] = va_arg(var, int);
-    va_end(var);
+    XI_VERIFY_VALUATORS(num_valuators);
 
     GetEventList(&xf86Events);
     nevents = GetPointerEvents(xf86Events, device,
@@ -878,7 +896,7 @@ xf86PostKeyEvent(DeviceIntPtr	device,
                  ...)
 {
     va_list var;
-    int i = 0, nevents = 0;
+    int i = 0;
     static int valuators[MAX_VALUATORS];
 
     /* instil confidence in the user */
@@ -886,18 +904,37 @@ xf86PostKeyEvent(DeviceIntPtr	device,
            "badly south after this message, then xf86PostKeyEvent is "
            "broken.\n");
 
-    if (num_valuators > MAX_VALUATORS) {
-	xf86Msg(X_ERROR, "%s: num_valuator %d is greater than"
-	    " MAX_VALUATORS\n", __FUNCTION__, num_valuators);
-	return;
-    }
+    XI_VERIFY_VALUATORS(num_valuators);
 
-    if (is_absolute) {
-        va_start(var, num_valuators);
-        for (i = 0; i < num_valuators; i++)
-            valuators[i] = va_arg(var, int);
-        va_end(var);
+    va_start(var, num_valuators);
+    for (i = 0; i < num_valuators; i++)
+      valuators[i] = va_arg(var, int);
+    va_end(var);
+
+    xf86PostKeyEventP(device, key_code, is_down, is_absolute, first_valuator,
+		      num_valuators, valuators);
+
+}
+
+void
+xf86PostKeyEventP(DeviceIntPtr	device,
+                  unsigned int	key_code,
+                  int		is_down,
+                  int		is_absolute,
+                  int		first_valuator,
+                  int		num_valuators,
+                  int		*valuators)
+{
+    int i = 0, nevents = 0;
+
+    /* instil confidence in the user */
+    DebugF("this function has never been tested properly.  if things go quite "
+           "badly south after this message, then xf86PostKeyEvent is "
+           "broken.\n");
+
+    XI_VERIFY_VALUATORS(num_valuators);
 
+    if (is_absolute) {
         GetEventList(&xf86Events);
         nevents = GetKeyboardValuatorEvents(xf86Events, device,
                                             is_down ? KeyPress : KeyRelease,
@@ -919,28 +956,7 @@ xf86PostKeyboardEvent(DeviceIntPtr      device,
                       unsigned int      key_code,
                       int               is_down)
 {
-    int nevents = 0, i = 0;
-    int index;
-
-#if XFreeXDGA
-    DeviceIntPtr pointer;
-
-    /* Some pointers send key events, paired device is wrong then. */
-    pointer = IsPointerDevice(device) ? device : GetPairedDevice(device);
-
-    if (miPointerGetScreen(pointer)) {
-        index = miPointerGetScreen(pointer)->myNum;
-        if (DGAStealKeyEvent(device, index, key_code, is_down))
-            return;
-    }
-#endif
-
-    GetEventList(&xf86Events);
-    nevents = GetKeyboardEvents(xf86Events, device,
-                                is_down ? KeyPress : KeyRelease, key_code);
-
-    for (i = 0; i < nevents; i++)
-        mieqEnqueue(device, (InternalEvent*)((xf86Events + i)->event));
+    xf86PostKeyEventP(device, key_code, is_down, 0, 0, 0, NULL);
 }
 
 LocalDevicePtr
diff --git a/hw/xfree86/common/xf86Xinput.h b/hw/xfree86/common/xf86Xinput.h
index 0ad5664..b1b88ac 100644
--- a/hw/xfree86/common/xf86Xinput.h
+++ b/hw/xfree86/common/xf86Xinput.h
@@ -80,6 +80,14 @@
 #define XI_PRIVATE(dev) \
 	(((LocalDevicePtr)((dev)->public.devicePrivate))->private)
 
+/* Valuator verification macro */
+#define XI_VERIFY_VALUATORS(num_valuators)					\
+	if (num_valuators > MAX_VALUATORS) {					\
+		xf86Msg(X_ERROR, "%s: num_valuator %d is greater than"		\
+			" MAX_VALUATORS\n", __FUNCTION__, num_valuators);	\
+		return;								\
+	}
+
 /* Stupid API backwards-compatibility. */
 #define TS_Raw 60
 #define TS_Scaled 61
@@ -158,12 +166,20 @@ extern _X_EXPORT void xf86PostMotionEventP(DeviceIntPtr device, int is_absolute,
 			 int first_valuator, int num_valuators, int *valuators);
 extern _X_EXPORT void xf86PostProximityEvent(DeviceIntPtr device, int is_in,
 			    int first_valuator, int num_valuators, ...);
+extern _X_EXPORT void xf86PostProximityEventP(DeviceIntPtr device, int is_in, int first_valuator,
+			     int num_valuators, int *valuators);
 extern _X_EXPORT void xf86PostButtonEvent(DeviceIntPtr device, int is_absolute, int button,
 		    	 int is_down, int first_valuator, int num_valuators,
 			 ...);
+extern _X_EXPORT void xf86PostButtonEventP(DeviceIntPtr device, int is_absolute, int button,
+			  int is_down, int first_valuator, int num_valuators,
+			  int *valuators);
 extern _X_EXPORT void xf86PostKeyEvent(DeviceIntPtr device, unsigned int key_code, int is_down,
 		      int is_absolute, int first_valuator, int num_valuators,
 		      ...);
+extern _X_EXPORT void xf86PostKeyEventP(DeviceIntPtr device, unsigned int key_code, int is_down,
+		       int is_absolute, int first_valuator, int num_valuators,
+		       int *valuators);
 extern _X_EXPORT void xf86PostKeyboardEvent(DeviceIntPtr device, unsigned int key_code,
                            int is_down);
 extern _X_EXPORT int xf86ActivateDevice(LocalDevicePtr local);
commit a148d407429c7d13136b3fcafd2d279c5438df73
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Jul 28 16:53:51 2009 +1000

    xkb: restore XKB PtrBtn actions.
    
    Ifdef'd out since the switch to internal events. PtrBtn actions now work
    again. Instead of generating the event directly, GPE generates the event and
    it is then posted through the usual event processing routines
    (mieqProcessDeviceEvent).
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/xkb/ddxDevBtn.c b/xkb/ddxDevBtn.c
index e735fde..94630d1 100644
--- a/xkb/ddxDevBtn.c
+++ b/xkb/ddxDevBtn.c
@@ -35,98 +35,43 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #include "inputstr.h"
 #include "scrnintstr.h"
 #include "windowstr.h"
+#include "eventstr.h"
 #include <xkbsrv.h>
+#include "mi.h"
 #include <X11/extensions/XI.h>
 #include <X11/extensions/XIproto.h>
 
-extern	int	DeviceValuator;
-
-static EventListPtr masterEvents = NULL;
-
 void
 XkbDDXFakeDeviceButton(DeviceIntPtr dev,Bool press,int button)
 {
-int *			devVal;
-INT32 *			evVal;
-xEvent			events[2];
-deviceKeyButtonPointer *btn;
-deviceValuator *	val;
-int			x,y;
-int			nAxes, i, count;
-DeviceIntPtr		master = NULL;
-
-    if (dev == inputInfo.pointer || !dev->public.on)
-	return;
-
-    ErrorF("[xkb] XkbDDXFakeDeviceButton. If you read this message in your "
-           "log file, Please file a bug on bugs.freedesktop.org.\n");
-#if 0
-    nAxes = (dev->valuator?dev->valuator->numAxes:0);
-    if (nAxes > 6)
-	nAxes = 6;
-
-    GetSpritePosition(dev, &x,&y);
-    btn= (deviceKeyButtonPointer *) &events[0];
-    val= (deviceValuator *) &events[1];
-    if (press)		btn->type= DeviceButtonPress;
-    else		btn->type= DeviceButtonRelease;
-    btn->detail= 	button;
-    btn->time= 		GetTimeInMillis();
-    btn->root_x=	x;
-    btn->root_y=	y;
-    btn->deviceid= 	dev->id;
-    count= 1;
-    if (nAxes>0) {
-	btn->deviceid|=	0x80;
-	val->type = DeviceValuator;
-	val->deviceid = dev->id;
-	val->first_valuator = 0;
+    EventListPtr        events;
+    int                 nevents, i;
+    DeviceIntPtr        ptr;
 
-	evVal=	&val->valuator0;
-	devVal= dev->valuator->axisVal;
-	for (i=nAxes;i>0;i--) {
-	    *evVal++ = *devVal++;
-	    if (evVal > &val->valuator5) {
-		int	tmp = val->first_valuator+6;
-		val->num_valuators = 6;
-		val++;
-		evVal= &val->valuator0;
-		val->first_valuator= tmp;
-	    }
-	}
-	if ((nAxes % 6) != 0) {
-	    val->num_valuators = (nAxes % 6);
-	}
-	count= 1+((nAxes+5)/6);
-    }
-
-    /* XXX: This is obnoxious. ProcessOtherEvent updates the DIX device state,
-     * but may not do anything if the device state is invalid. This happens if
-     * we post a mouse event from a pure keyboard device. So we need to hack
-     * around that by getting the master, then posting the event for the
-     * pointer paired with the master.
+    /* If dev is a slave device, and the SD is attached, do nothing. If we'd
+     * post through the attached master pointer we'd get duplicate events.
+     *
+     * if dev is a master keyboard, post through the master pointer.
      *
-     * Note:the DeviceButtonEvent on the SD itself will do nothing in most
-     * cases, unless dev is both a keyboard and a mouse.
+     * if dev is a floating slave, post through the device itself.
      */
-    if (!dev->isMaster && dev->u.master) {
-        if (!masterEvents)
-        {
-            masterEvents = InitEventList(1);
-            SetMinimumEventSize(masterEvents, 1, (1 + MAX_VALUATOR_EVENTS) * sizeof(xEvent));
-        }
-        master = dev->u.master;
-        if (!IsPointerDevice(master))
-            master = GetPairedDevice(dev->u.master);
 
-        CopyGetMasterEvent(master, dev, events, masterEvents, count);
-    }
+    if (IsMaster(dev))
+        ptr = GetMaster(dev, MASTER_POINTER);
+    else if (!dev->u.master)
+        ptr = dev;
+    else
+        return;
 
-    (*dev->public.processInputProc)((xEventPtr)btn, dev, count);
+    events = InitEventList(GetMaximumEventsNum());
+    nevents = GetPointerEvents(events, ptr,
+                               press ? ButtonPress : ButtonRelease, button,
+                               0 /* flags */, 0 /* first */,
+                               0 /* num_val */, NULL);
 
-    if (master) {
-        (*master->public.processInputProc)(masterEvents->event, master, count);
-    }
-    return;
-#endif
+
+    for (i = 0; i < nevents; i++)
+        mieqProcessDeviceEvent(ptr, (InternalEvent*)events[i].event, NULL);
+
+    FreeEventList(events, GetMaximumEventsNum());
 }
commit 3d3b8babd1a5407082f1a40875ed69f62ba2153f
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Jul 28 16:51:14 2009 +1000

    mi: update master event copying to InternalEvents.
    
    This is long overdue. The device events are InternalEvents now (and only one
    at a time), diminishing the need for an EventList for the master event.
    Furthermore, don't make masterEvent a static since this will interfere if
    mieqProcessDeviceEvent is called from somewhere else (e.g. XKB actions).
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/mi/mi.h b/mi/mi.h
index 4431239..3db8bfc 100644
--- a/mi/mi.h
+++ b/mi/mi.h
@@ -224,7 +224,7 @@ extern _X_EXPORT void mieqProcessInputEvents(
 extern DeviceIntPtr CopyGetMasterEvent(
     DeviceIntPtr /* sdev */,
     InternalEvent* /* original */,
-    EventListPtr /* mlist */
+    InternalEvent* /* copy */
 );
 
 /**
diff --git a/mi/mieq.c b/mi/mieq.c
index 539a99f..6ec2dba 100644
--- a/mi/mieq.c
+++ b/mi/mieq.c
@@ -78,7 +78,6 @@ typedef struct _EventQueue {
 } EventQueueRec, *EventQueuePtr;
 
 static EventQueueRec miEventQueue;
-static EventListPtr masterEvents; /* for use in mieqProcessInputEvents */
 
 #ifdef XQUARTZ
 #include  <pthread.h>
@@ -117,16 +116,6 @@ mieqInit(void)
         miEventQueue.events[i].events = evlist;
     }
 
-    /* XXX: mE is just 1 event long, if we have Motion + Valuator they are
-     * squashed into the first event to make passing it into the event
-     * processing handlers easier. This should be fixed when the processing
-     * handlers switch to EventListPtr instead of xEvent */
-    masterEvents = InitEventList(1);
-    if (!masterEvents)
-        FatalError("Could not allocated MD event queue.\n");
-    SetMinimumEventSize(masterEvents, 1,
-                        (1 + MAX_VALUATOR_EVENTS) * sizeof(xEvent));
-
     SetInputCheck(&miEventQueue.head, &miEventQueue.tail);
     return TRUE;
 }
@@ -317,16 +306,15 @@ FixUpEventForMaster(DeviceIntPtr mdev, DeviceIntPtr sdev,
  * Copy the given event into master.
  * @param sdev The slave device the original event comes from
  * @param original The event as it came from the EQ
- * @param master The event after being copied
+ * @param copy The event after being copied
  * @return The master device or NULL if the device is a floating slave.
  */
 DeviceIntPtr
 CopyGetMasterEvent(DeviceIntPtr sdev,
-                   InternalEvent* original, EventListPtr mlist)
+                   InternalEvent* original, InternalEvent *copy)
 {
     DeviceIntPtr mdev;
     int len = original->any.length;
-    InternalEvent *mevent;
 
     CHECKEVENT(original);
 
@@ -351,15 +339,9 @@ CopyGetMasterEvent(DeviceIntPtr sdev,
             break;
     }
 
-
-    if (mlist->evlen < len)
-        SetMinimumEventSize(mlist, 1, len);
-
-    mevent = (InternalEvent*)mlist->event;
-
-    memcpy(mevent, original, len);
-    ChangeDeviceID(mdev, mevent);
-    FixUpEventForMaster(mdev, sdev, original, mevent);
+    memcpy(copy, original, len);
+    ChangeDeviceID(mdev, copy);
+    FixUpEventForMaster(mdev, sdev, original, copy);
 
     return mdev;
 }
@@ -378,6 +360,7 @@ mieqProcessDeviceEvent(DeviceIntPtr dev,
     mieqHandler handler;
     int x = 0, y = 0;
     DeviceIntPtr master;
+    InternalEvent mevent; /* master event */
 
     CHECKEVENT(event);
 
@@ -392,7 +375,7 @@ mieqProcessDeviceEvent(DeviceIntPtr dev,
         NewCurrentScreen (dev, DequeueScreen(dev), x, y);
     }
     else {
-        master = CopyGetMasterEvent(dev, event, masterEvents);
+        master = CopyGetMasterEvent(dev, event, &mevent);
 
         if (master)
             master->u.lastSlave = dev;
@@ -406,7 +389,7 @@ mieqProcessDeviceEvent(DeviceIntPtr dev,
             /* Check for the SD's master in case the device got detached
              * during event processing */
             if (master && dev->u.master)
-                handler(screenNum, (InternalEvent*)masterEvents->event, master);
+                handler(screenNum, &mevent, master);
         } else
         {
             /* process slave first, then master */
@@ -415,9 +398,7 @@ mieqProcessDeviceEvent(DeviceIntPtr dev,
             /* Check for the SD's master in case the device got detached
              * during event processing */
             if (master && dev->u.master)
-                master->public.processInputProc(
-                        (InternalEvent*)masterEvents->event,
-                        master);
+                master->public.processInputProc(&mevent, master);
         }
     }
 }
commit f85619b14d130ec54d42cabfaee15e55ced0c665
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Jul 28 16:48:56 2009 +1000

    dix: update GetMaximumEventsNum() to real value (3).
    
    GPE and friends now use internal events so they may generate up to 3 events.
    One (optional) DeviceChanged event and one raw event plus a device event.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/getevents.c b/dix/getevents.c
index ffd7497..5f00954 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -567,13 +567,11 @@ updateMotionHistory(DeviceIntPtr pDev, CARD32 ms, int first_valuator,
  */
 int
 GetMaximumEventsNum(void) {
-    /* One base event -- device, plus valuator events. */
-    int ret = 1 + MAX_VALUATOR_EVENTS;
-
-    /* One possible DeviceClassesChangedEvent */
-    ret++;
-
-    return ret;
+    /* One raw event
+     * One device event
+     * One possible device changed event
+     */
+    return 3;
 }
 
 
commit 0217d0370c0b0bce66a9c09092eda8e820274e2e
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Jul 28 14:54:30 2009 +1000

    record: ifdef out RecordExtensionInit and print a warning to the log.
    
    The RECORD extension is currently broken. By ifdef'ing out the content of
    RecordExtensionInit the extension isn't added to the server's internal list
    and it does not get advertised to the client. Clients can thus fail
    gracefully with a "extension not supported" instead of waiting forever for
    events that never arrive.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/record/record.c b/record/record.c
index fd88552..effb926 100644
--- a/record/record.c
+++ b/record/record.c
@@ -2865,6 +2865,13 @@ RecordCloseDown(ExtensionEntry *extEntry)
 void 
 RecordExtensionInit(void)
 {
+    /* FIXME Record is currently broken. Dont initialize it so that clients
+     * that require it can bail out correctly rather than waiting for stuff
+     * that'll never happen */
+    ErrorF("record: RECORD extension enabled at configure time.\n");
+    ErrorF("record: This extension is known to be broken, disabling extension now..\n");
+    ErrorF("record: http://bugs.freedesktop.org/show_bug.cgi?id=20500\n");
+#if 0
     ExtensionEntry *extentry;
 
     RTContext = CreateNewResourceType(RecordDeleteContext);
@@ -2887,5 +2894,6 @@ RecordExtensionInit(void)
     }
     RecordErrorBase = extentry->errorBase;
 
+#endif
 } /* RecordExtensionInit */
 
commit 4e9b2938cd8637a5d3b0a4c9f69d6ee75faab3a0
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Jul 27 16:54:33 2009 +1000

    include: untangle events.h from the SDK headers.
    
    InternalEvents shouldn't be used anywhere outside the X server itself. Split
    up into events.h for opaque typedefs for the events needed by various
    headers and eventstr.h for the actual struct definitions.
    
    eventstr.h must only be included by code that requires internal events and
    is not part of the SDK.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xi/exevents.c b/Xi/exevents.c
index 984bc07..5c43266 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -76,6 +76,7 @@ SOFTWARE.
 #include "xace.h"
 #include "xiquerydevice.h" /* For List*Info */
 #include "eventconvert.h"
+#include "eventstr.h"
 
 #include <X11/extensions/XKBproto.h>
 #include "xkbsrv.h"
diff --git a/dix/devices.c b/dix/devices.c
index 4d006b1..32fd445 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -72,6 +72,7 @@ SOFTWARE.
 #include "swaprep.h"
 #include "dixevents.h"
 #include "mipointer.h"
+#include "eventstr.h"
 
 #include <X11/extensions/XI.h>
 #include <X11/extensions/XI2.h>
diff --git a/dix/eventconvert.c b/dix/eventconvert.c
index 039a17f..943178e 100644
--- a/dix/eventconvert.c
+++ b/dix/eventconvert.c
@@ -42,7 +42,7 @@
 #include "dix.h"
 #include "inputstr.h"
 #include "misc.h"
-#include "events.h"
+#include "eventstr.h"
 #include "exglobals.h"
 #include "eventconvert.h"
 #include "xiquerydevice.h"
diff --git a/dix/events.c b/dix/events.c
index f50229a..a6a1075 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -162,6 +162,7 @@ typedef const char *string;
 #include "geext.h"
 #include "geint.h"
 
+#include "eventstr.h"
 #include "enterleave.h"
 #include "eventconvert.h"
 
diff --git a/dix/getevents.c b/dix/getevents.c
index 9895642..ffd7497 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -43,7 +43,7 @@
 #include "globals.h"
 #include "dixevents.h"
 #include "mipointer.h"
-#include "events.h"
+#include "eventstr.h"
 #include "eventconvert.h"
 
 #include <X11/extensions/XKBproto.h>
diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index 5e7ff53..318d233 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -46,6 +46,7 @@
 #include "exevents.h"
 #include "extinit.h"
 #include "exglobals.h"
+#include "eventstr.h"
 #include "xserver-properties.h"
 
 #define AtomFromName(x) MakeAtom(x, strlen(x), 1)
diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c
index 5716989..4509541 100644
--- a/hw/xfree86/common/xf86DGA.c
+++ b/hw/xfree86/common/xf86DGA.c
@@ -46,7 +46,7 @@
 #include "xf86Xinput.h"
 #include "exglobals.h"
 #include "exevents.h"
-#include "events.h"
+#include "eventstr.h"
 #include "eventconvert.h"
 
 #include "mi.h"
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index b4169cf..7b5904e 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -72,6 +72,7 @@
 
 #include "exevents.h"	/* AddInputDevice */
 #include "exglobals.h"
+#include "eventstr.h"
 
 #include "extnsionst.h"
 
diff --git a/include/Makefile.am b/include/Makefile.am
index 50b75c2..f8eef53 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -65,4 +65,4 @@ AM_CFLAGS = $(DIX_CFLAGS)
 
 EXTRA_DIST = 	\
 	dix-config-apple-verbatim.h \
-	eventconvert.h
+	eventconvert.h eventstr.h
diff --git a/include/events.h b/include/events.h
index 4b0c6dc..9f6a94c 100644
--- a/include/events.h
+++ b/include/events.h
@@ -24,212 +24,12 @@
 
 #ifndef EVENTS_H
 #define EVENTS_H
-
-/**
- * @file events.h
- * This file describes the event structures used internally by the X
- * server during event generation and event processing.
- *
- * When are internal events used?
- * Events from input devices are stored as internal events in the EQ and
- * processed as internal events until late in the processing cycle. Only then
- * do they switch to their respective wire events.
- */
-
-/**
- * Event types. Used exclusively internal to the server, not visible on the
- * protocol.
- *
- * Note: Keep KeyPress to Motion aligned with the core events.
- *       Keep ET_Raw* in the same order as KeyPress - Motion
- */
-enum {
-    ET_KeyPress = 2,
-    ET_KeyRelease,
-    ET_ButtonPress,
-    ET_ButtonRelease,
-    ET_Motion,
-    ET_Enter,
-    ET_Leave,
-    ET_FocusIn,
-    ET_FocusOut,
-    ET_ProximityIn,
-    ET_ProximityOut,
-    ET_DeviceChanged,
-    ET_Hierarchy,
-#if XFreeXDGA
-    ET_DGAEvent,
-#endif
-    ET_RawKeyPress,
-    ET_RawKeyRelease,
-    ET_RawButtonPress,
-    ET_RawButtonRelease,
-    ET_RawMotion,
-    ET_Internal = 0xFF /* First byte */
-} EventType;
-
-#define CHECKEVENT(ev) if (ev && ((InternalEvent*)(ev))->any.header != 0xFF) \
-                          FatalError("Wrong event type %d.\n", \
-                                     ((InternalEvent*)(ev))->any.header);
-
-/**
- * Used for ALL input device events internal in the server until
- * copied into the matching protocol event.
- *
- * Note: We only use the device id because the DeviceIntPtr may become invalid while
- * the event is in the EQ.
- */
-typedef struct
-{
-    unsigned char header; /**< Always ET_Internal */
-    int type;             /**< One of EventType */
-    int length;           /**< Length in bytes */
-    Time time;            /**< Time in ms */
-    int deviceid;         /**< Device to post this event for */
-    int sourceid;         /**< The physical source device */
-    union {
-        uint32_t button;  /**< Button number */
-        uint32_t key;     /**< Key code */
-    } detail;
-    uint16_t root_x;      /**< Pos relative to root window in integral data */
-    float root_x_frac;    /**< Pos relative to root window in frac part */
-    uint16_t root_y;      /**< Pos relative to root window in integral part */
-    float root_y_frac;    /**< Pos relative to root window in frac part */
-    uint8_t    buttons[(MAX_BUTTONS + 7)/8]; /**< Button mask */
-    struct {
-        uint8_t  mask[(MAX_VALUATORS + 7)/8]; /**< Valuator mask */
-        uint8_t  mode[(MAX_VALUATORS + 7)/8]; /**< Valuator mode (Abs or Rel)*/
-        uint32_t data[MAX_VALUATORS];         /**< Valuator data */
-        int32_t  data_frac[MAX_VALUATORS];    /**< Fractional part for data */
-    } valuators;
-    struct {
-        uint32_t base;    /**< XKB base modifiers */
-        uint32_t latched; /**< XKB latched modifiers */
-        uint32_t locked;  /**< XKB locked modifiers */
-        uint32_t effective;/**< XKB effective modifiers */
-    } mods;
-    struct {
-        uint8_t base;    /**< XKB base group */
-        uint8_t latched; /**< XKB latched group */
-        uint8_t locked;  /**< XKB locked group */
-        uint8_t effective;/**< XKB effective group */
-    } group;
-    Window      root; /**< Root window of the event */
-    int corestate;    /**< Core key/button state BEFORE the event */
-} DeviceEvent;
-
-
-/* Flags used in DeviceChangedEvent to signal if new/old slave is present. */
-#define DEVCHANGE_HAS_OLD_SLAVE 0x1
-#define DEVCHANGE_HAS_NEW_SLAVE 0x2
-/* Flags used in DeviceChangedEvent to signal whether the event was a
- * pointer event or a keyboard event */
-#define DEVCHANGE_POINTER_EVENT 0x4
-#define DEVCHANGE_KEYBOARD_EVENT 0x8
-/* device capabilities changed */
-#define DEVCHANGE_DEVICE_CHANGE 0x10
-
-/**
- * Sent whenever a device's capabilities have changed.
- */
-typedef struct
-{
-    unsigned char header; /**< Always ET_Internal */
-    int type;             /**< ET_DeviceChanged */
-    int length;           /**< Length in bytes */
-    Time time;            /**< Time in ms */
-    int deviceid;         /**< Device whose capabilities have changed */
-    int flags;            /**< Mask of ::HAS_OLD_SLAVE, ::HAS_NEW_SLAVE,
-                               ::POINTER_EVENT, ::KEYBOARD_EVENT */
-    /** If flags & HAS_OLD_SLAVE is set, old_slaveid specifies SD previously
-     * attached to this device. */
-    int old_slaveid;
-    /** If flags & HAS_OLD_SLAVE is set, old_slaveid specifies device now
-     * attached to this device. */
-    int new_slaveid;
-
-    struct {
-        int num_buttons;        /**< Number of buttons */
-        Atom names[MAX_BUTTONS];/**< Button names */
-    } buttons;
-
-    int num_valuators;          /**< Number of axes */
-    struct {
-        uint32_t min;           /**< Minimum value */
-        uint32_t max;           /**< Maximum value */
-        /* FIXME: frac parts of min/max */
-        uint32_t resolution;    /**< Resolution counts/m */
-        uint8_t mode;           /**< Relative or Absolute */
-        Atom name;              /**< Axis name */
-    } valuators[MAX_VALUATORS];
-
-    struct {
-        int min_keycode;
-        int max_keycode;
-    } keys;
-} DeviceChangedEvent;
-
-#if XFreeXDGA
-/**
- * DGAEvent, used by DGA to intercept and emulate input events.
- */
-typedef struct
-{
-    unsigned char header; /**<  Always ET_Internal */
-    int type;             /**<  ET_DGAEvent */
-    int length;           /**<  Length in bytes */
-    Time time;            /**<  Time in ms */
-    int subtype;          /**<  KeyPress, KeyRelease, ButtonPress,
-                                ButtonRelease, MotionNotify */
-    int detail;           /**<  Relative x coordinate */
-    int dx;               /**<  Relative x coordinate */
-    int dy;               /**<  Relative y coordinate */
-    int screen;           /**<  Screen number this event applies to */
-    uint16_t state;       /**<  Core modifier/button state */
-} DGAEvent;
-#endif
-
-/**
- * Raw event, contains the data as posted by the device.
- */
-typedef struct
-{
-    unsigned char header; /**<  Always ET_Internal */
-    int type;             /**<  ET_Raw */
-    int length;           /**<  Length in bytes */
-    Time time;            /**<  Time in ms */
-    int deviceid;         /**< Device to post this event for */
-    int sourceid;         /**< The physical source device */
-    union {
-        uint32_t button;  /**< Button number */
-        uint32_t key;     /**< Key code */
-    } detail;
-    struct {
-        uint8_t  mask[(MAX_VALUATORS + 7)/8]; /**< Valuator mask */
-        int32_t  data[MAX_VALUATORS];         /**< Valuator data */
-        int32_t  data_frac[MAX_VALUATORS];    /**< Fractional part for data */
-        int32_t  data_raw[MAX_VALUATORS];     /**< Valuator data as posted */
-        int32_t  data_raw_frac[MAX_VALUATORS];/**< Fractional part for data_raw */
-    } valuators;
-} RawDeviceEvent;
-
-/**
- * Event type used inside the X server for input event
- * processing.
- */
-typedef union {
-        struct {
-            unsigned char header; /**< Always ET_Internal */
-            int type;             /**< One of ET_* */
-            int length;           /**< Length in bytes */
-            Time time;            /**< Time in ms. */
-        } any;
-        DeviceEvent device;
-        DeviceChangedEvent changed;
+typedef struct _DeviceEvent DeviceEvent;
+typedef struct _DeviceChangedEvent DeviceChangedEvent;
 #if XFreeXDGA
-        DGAEvent dga;
+typedef struct _DGAEvent DGAEvent;
 #endif
-        RawDeviceEvent raw;
-} InternalEvent;
+typedef struct _RawDeviceEvent RawDeviceEvent;
+typedef union _InternalEvent InternalEvent;
 
 #endif
diff --git a/include/eventstr.h b/include/eventstr.h
new file mode 100644
index 0000000..3eefc05
--- /dev/null
+++ b/include/eventstr.h
@@ -0,0 +1,236 @@
+/*
+ * Copyright © 2009 Red Hat, Inc.
+ *
+ * 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.
+ *
+ */
+
+#ifndef EVENTSTR_H
+#define EVENTSTR_H
+
+#include <events.h>
+/**
+ * @file events.h
+ * This file describes the event structures used internally by the X
+ * server during event generation and event processing.
+ *
+ * When are internal events used?
+ * Events from input devices are stored as internal events in the EQ and
+ * processed as internal events until late in the processing cycle. Only then
+ * do they switch to their respective wire events.
+ */
+
+/**
+ * Event types. Used exclusively internal to the server, not visible on the
+ * protocol.
+ *
+ * Note: Keep KeyPress to Motion aligned with the core events.
+ *       Keep ET_Raw* in the same order as KeyPress - Motion
+ */
+enum {
+    ET_KeyPress = 2,
+    ET_KeyRelease,
+    ET_ButtonPress,
+    ET_ButtonRelease,
+    ET_Motion,
+    ET_Enter,
+    ET_Leave,
+    ET_FocusIn,
+    ET_FocusOut,
+    ET_ProximityIn,
+    ET_ProximityOut,
+    ET_DeviceChanged,
+    ET_Hierarchy,
+#if XFreeXDGA
+    ET_DGAEvent,
+#endif
+    ET_RawKeyPress,
+    ET_RawKeyRelease,
+    ET_RawButtonPress,
+    ET_RawButtonRelease,
+    ET_RawMotion,
+    ET_Internal = 0xFF /* First byte */
+} EventType;
+
+#define CHECKEVENT(ev) if (ev && ((InternalEvent*)(ev))->any.header != 0xFF) \
+                          FatalError("Wrong event type %d.\n", \
+                                     ((InternalEvent*)(ev))->any.header);
+
+/**
+ * Used for ALL input device events internal in the server until
+ * copied into the matching protocol event.
+ *
+ * Note: We only use the device id because the DeviceIntPtr may become invalid while
+ * the event is in the EQ.
+ */
+struct _DeviceEvent
+{
+    unsigned char header; /**< Always ET_Internal */
+    int type;             /**< One of EventType */
+    int length;           /**< Length in bytes */
+    Time time;            /**< Time in ms */
+    int deviceid;         /**< Device to post this event for */
+    int sourceid;         /**< The physical source device */
+    union {
+        uint32_t button;  /**< Button number */
+        uint32_t key;     /**< Key code */
+    } detail;
+    uint16_t root_x;      /**< Pos relative to root window in integral data */
+    float root_x_frac;    /**< Pos relative to root window in frac part */
+    uint16_t root_y;      /**< Pos relative to root window in integral part */
+    float root_y_frac;    /**< Pos relative to root window in frac part */
+    uint8_t    buttons[(MAX_BUTTONS + 7)/8]; /**< Button mask */
+    struct {
+        uint8_t  mask[(MAX_VALUATORS + 7)/8]; /**< Valuator mask */
+        uint8_t  mode[(MAX_VALUATORS + 7)/8]; /**< Valuator mode (Abs or Rel)*/
+        uint32_t data[MAX_VALUATORS];         /**< Valuator data */
+        int32_t  data_frac[MAX_VALUATORS];    /**< Fractional part for data */
+    } valuators;
+    struct {
+        uint32_t base;    /**< XKB base modifiers */
+        uint32_t latched; /**< XKB latched modifiers */
+        uint32_t locked;  /**< XKB locked modifiers */
+        uint32_t effective;/**< XKB effective modifiers */
+    } mods;
+    struct {
+        uint8_t base;    /**< XKB base group */
+        uint8_t latched; /**< XKB latched group */
+        uint8_t locked;  /**< XKB locked group */
+        uint8_t effective;/**< XKB effective group */
+    } group;
+    Window      root; /**< Root window of the event */
+    int corestate;    /**< Core key/button state BEFORE the event */
+};
+
+
+/* Flags used in DeviceChangedEvent to signal if new/old slave is present. */
+#define DEVCHANGE_HAS_OLD_SLAVE 0x1
+#define DEVCHANGE_HAS_NEW_SLAVE 0x2
+/* Flags used in DeviceChangedEvent to signal whether the event was a
+ * pointer event or a keyboard event */
+#define DEVCHANGE_POINTER_EVENT 0x4
+#define DEVCHANGE_KEYBOARD_EVENT 0x8
+/* device capabilities changed */
+#define DEVCHANGE_DEVICE_CHANGE 0x10
+
+/**
+ * Sent whenever a device's capabilities have changed.
+ */
+struct _DeviceChangedEvent
+{
+    unsigned char header; /**< Always ET_Internal */
+    int type;             /**< ET_DeviceChanged */
+    int length;           /**< Length in bytes */
+    Time time;            /**< Time in ms */
+    int deviceid;         /**< Device whose capabilities have changed */
+    int flags;            /**< Mask of ::HAS_OLD_SLAVE, ::HAS_NEW_SLAVE,
+                               ::POINTER_EVENT, ::KEYBOARD_EVENT */
+    /** If flags & HAS_OLD_SLAVE is set, old_slaveid specifies SD previously
+     * attached to this device. */
+    int old_slaveid;
+    /** If flags & HAS_OLD_SLAVE is set, old_slaveid specifies device now
+     * attached to this device. */
+    int new_slaveid;
+
+    struct {
+        int num_buttons;        /**< Number of buttons */
+        Atom names[MAX_BUTTONS];/**< Button names */
+    } buttons;
+
+    int num_valuators;          /**< Number of axes */
+    struct {
+        uint32_t min;           /**< Minimum value */
+        uint32_t max;           /**< Maximum value */
+        /* FIXME: frac parts of min/max */
+        uint32_t resolution;    /**< Resolution counts/m */
+        uint8_t mode;           /**< Relative or Absolute */
+        Atom name;              /**< Axis name */
+    } valuators[MAX_VALUATORS];
+
+    struct {
+        int min_keycode;
+        int max_keycode;
+    } keys;
+};
+
+#if XFreeXDGA
+/**
+ * DGAEvent, used by DGA to intercept and emulate input events.
+ */
+struct _DGAEvent
+{
+    unsigned char header; /**<  Always ET_Internal */
+    int type;             /**<  ET_DGAEvent */
+    int length;           /**<  Length in bytes */
+    Time time;            /**<  Time in ms */
+    int subtype;          /**<  KeyPress, KeyRelease, ButtonPress,
+                                ButtonRelease, MotionNotify */
+    int detail;           /**<  Relative x coordinate */
+    int dx;               /**<  Relative x coordinate */
+    int dy;               /**<  Relative y coordinate */
+    int screen;           /**<  Screen number this event applies to */
+    uint16_t state;       /**<  Core modifier/button state */
+};
+#endif
+
+/**
+ * Raw event, contains the data as posted by the device.
+ */
+struct _RawDeviceEvent
+{
+    unsigned char header; /**<  Always ET_Internal */
+    int type;             /**<  ET_Raw */
+    int length;           /**<  Length in bytes */
+    Time time;            /**<  Time in ms */
+    int deviceid;         /**< Device to post this event for */
+    int sourceid;         /**< The physical source device */
+    union {
+        uint32_t button;  /**< Button number */
+        uint32_t key;     /**< Key code */
+    } detail;
+    struct {
+        uint8_t  mask[(MAX_VALUATORS + 7)/8]; /**< Valuator mask */
+        int32_t  data[MAX_VALUATORS];         /**< Valuator data */
+        int32_t  data_frac[MAX_VALUATORS];    /**< Fractional part for data */
+        int32_t  data_raw[MAX_VALUATORS];     /**< Valuator data as posted */
+        int32_t  data_raw_frac[MAX_VALUATORS];/**< Fractional part for data_raw */
+    } valuators;
+};
+
+/**
+ * Event type used inside the X server for input event
+ * processing.
+ */
+union _InternalEvent {
+        struct {
+            unsigned char header; /**< Always ET_Internal */
+            int type;             /**< One of ET_* */
+            int length;           /**< Length in bytes */
+            Time time;            /**< Time in ms. */
+        } any;
+        DeviceEvent device;
+        DeviceChangedEvent changed;
+#if XFreeXDGA
+        DGAEvent dga;
+#endif
+        RawDeviceEvent raw;
+};
+
+#endif
diff --git a/include/input.h b/include/input.h
index 40ba660..e962696 100644
--- a/include/input.h
+++ b/include/input.h
@@ -54,6 +54,7 @@ SOFTWARE.
 #include <X11/Xproto.h>
 #include "window.h"     /* for WindowPtr */
 #include "xkbrules.h"
+#include "events.h"
 
 #define DEVICE_INIT	0
 #define DEVICE_ON	1
@@ -96,8 +97,6 @@ SOFTWARE.
 #define RevertToFollowKeyboard	3
 #endif
 
-#include "events.h"
-
 typedef unsigned long Leds;
 typedef struct _OtherClients *OtherClientsPtr;
 typedef struct _InputClients *InputClientsPtr;
diff --git a/mi/mieq.c b/mi/mieq.c
index 976fac9..539a99f 100644
--- a/mi/mieq.c
+++ b/mi/mieq.c
@@ -51,6 +51,7 @@ in this Software without prior written authorization from The Open Group.
 # include   <X11/extensions/geproto.h>
 # include   "extinit.h"
 # include   "exglobals.h"
+# include   "eventstr.h"
 
 #ifdef DPMSExtension
 # include "dpmsproc.h"
diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c
index f0f7578..7df8e06 100644
--- a/xkb/xkbAccessX.c
+++ b/xkb/xkbAccessX.c
@@ -36,6 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #include "exglobals.h"
 #include <X11/extensions/XIproto.h>
 #include "inputstr.h"
+#include "eventstr.h"
 #include <xkbsrv.h>
 #if !defined(WIN32)
 #include <sys/time.h>
diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c
index 5909b06..9c3184a 100644
--- a/xkb/xkbActions.c
+++ b/xkb/xkbActions.c
@@ -36,6 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #include "misc.h"
 #include "inputstr.h"
 #include "exevents.h"
+#include "eventstr.h"
 #include <xkbsrv.h>
 #include "xkb.h"
 #include <ctype.h>
diff --git a/xkb/xkbPrKeyEv.c b/xkb/xkbPrKeyEv.c
index effb0ea..e01282d 100644
--- a/xkb/xkbPrKeyEv.c
+++ b/xkb/xkbPrKeyEv.c
@@ -36,6 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #include "misc.h"
 #include "inputstr.h"
 #include "exevents.h"
+#include "eventstr.h"
 #include <xkbsrv.h>
 #include <ctype.h>
 #include "events.h"
diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c
index e25247f..06da1d5 100644
--- a/xkb/xkbUtils.c
+++ b/xkb/xkbUtils.c
@@ -62,6 +62,7 @@ DEALINGS IN THE SOFTWARE.
 #include <X11/keysym.h>
 #include "misc.h"
 #include "inputstr.h"
+#include "eventstr.h"
 
 #define	XKBSRV_NEED_FILE_FUNCS
 #include <xkbsrv.h>


More information about the xorg-commit mailing list