diff --git a/Xext/geext.c b/Xext/geext.c index 7c4573e8c..fed74dc54 100644 --- a/Xext/geext.c +++ b/Xext/geext.c @@ -235,8 +235,7 @@ GEExtensionInit(void) memset(GEExtensions, 0, sizeof(GEExtensions)); - EventSwapVector[GEEventBase + X_GenericEvent] = - (EventSwapPtr) SGEGenericEvent; + EventSwapVector[X_GenericEvent] = (EventSwapPtr) SGEGenericEvent; } else { FatalError("GEInit: AddExtensions failed.\n"); } diff --git a/Xi/chpkpair.c b/Xi/chpkpair.c index 555c8e1ca..db8e7f6cd 100644 --- a/Xi/chpkpair.c +++ b/Xi/chpkpair.c @@ -131,5 +131,7 @@ SPointerKeyboardPairingChangedNotifyEvent (pairingChangedNotify *from, *to = *from; swaps(&to->sequenceNumber, n); + swapl(&to->length, n); + swapl(&to->evtype, n); swapl(&to->time, n); } diff --git a/Xi/extinit.c b/Xi/extinit.c index 6d8c96141..bfb2bc78b 100644 --- a/Xi/extinit.c +++ b/Xi/extinit.c @@ -238,25 +238,6 @@ static XExtensionVersion thisversion = { XI_Present, XI_Add_DevicePresenceNotify_Minor }; -/**************************************************************** - * - * 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) - { - case XI_PointerKeyboardPairingChangedNotify: - SPointerKeyboardPairingChangedNotifyEvent - ((pairingChangedNotify*)from, (pairingChangedNotify*)to); - break; - } -} /************************************************************************* * @@ -700,6 +681,22 @@ SDeviceLeaveNotifyEvent (deviceLeaveNotify *from, deviceLeaveNotify *to) swaps(&to->eventY, n); } +static void +SRawDeviceEvent(rawDeviceEvent* from, rawDeviceEvent *to) +{ + char n; + int i; + CARD32* valptr; + + + *to = *from; + swaps(&to->sequenceNumber, n); + swapl(&to->length, n); + swapl(&to->evtype, n); + valptr = &to->valuator0; + for (i = 0; i < from->num_valuators; i++, valptr++) + swapl(valptr, n); +} /************************************************************************** * @@ -994,7 +991,6 @@ IResetProc(ExtensionEntry * unused) EventSwapVector[DevicePresenceNotify] = NotImplemented; EventSwapVector[DeviceEnterNotify] = NotImplemented; EventSwapVector[DeviceLeaveNotify] = NotImplemented; - EventSwapVector[PointerKeyboardPairingChangedNotify] = NotImplemented; RestoreExtensionEvents(); } @@ -1128,6 +1124,29 @@ 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) + { + case XI_PointerKeyboardPairingChangedNotify: + SPointerKeyboardPairingChangedNotifyEvent + ((pairingChangedNotify*)from, (pairingChangedNotify*)to); + break; + case XI_RawDeviceEvent: + SRawDeviceEvent((rawDeviceEvent*)from, (rawDeviceEvent*)to); + break; + } +} + /********************************************************************** * * IExtensionInit - initialize the input extension. @@ -1172,6 +1191,7 @@ XInputExtensionInit(void) EventSwapVector[DeviceLeaveNotify] = SEventIDispatch; /* init GE events */ + GERegisterExtension(IReqCode, XIGEEventSwap); SetGenericFilter(IReqCode, xi_filters); } else { FatalError("IExtensionInit: AddExtensions failed\n");