Cleaning up a bit.
Register correct event in EventSwapVector. Fix up event swap for GE events, register XI's swap function at GE.
This commit is contained in:
parent
e6fd4a24eb
commit
c03d9a7217
|
@ -235,8 +235,7 @@ GEExtensionInit(void)
|
||||||
|
|
||||||
memset(GEExtensions, 0, sizeof(GEExtensions));
|
memset(GEExtensions, 0, sizeof(GEExtensions));
|
||||||
|
|
||||||
EventSwapVector[GEEventBase + X_GenericEvent] =
|
EventSwapVector[X_GenericEvent] = (EventSwapPtr) SGEGenericEvent;
|
||||||
(EventSwapPtr) SGEGenericEvent;
|
|
||||||
} else {
|
} else {
|
||||||
FatalError("GEInit: AddExtensions failed.\n");
|
FatalError("GEInit: AddExtensions failed.\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,5 +131,7 @@ SPointerKeyboardPairingChangedNotifyEvent (pairingChangedNotify *from,
|
||||||
|
|
||||||
*to = *from;
|
*to = *from;
|
||||||
swaps(&to->sequenceNumber, n);
|
swaps(&to->sequenceNumber, n);
|
||||||
|
swapl(&to->length, n);
|
||||||
|
swapl(&to->evtype, n);
|
||||||
swapl(&to->time, n);
|
swapl(&to->time, n);
|
||||||
}
|
}
|
||||||
|
|
60
Xi/extinit.c
60
Xi/extinit.c
|
@ -238,25 +238,6 @@ static XExtensionVersion thisversion = { XI_Present,
|
||||||
XI_Add_DevicePresenceNotify_Minor
|
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);
|
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[DevicePresenceNotify] = NotImplemented;
|
||||||
EventSwapVector[DeviceEnterNotify] = NotImplemented;
|
EventSwapVector[DeviceEnterNotify] = NotImplemented;
|
||||||
EventSwapVector[DeviceLeaveNotify] = NotImplemented;
|
EventSwapVector[DeviceLeaveNotify] = NotImplemented;
|
||||||
EventSwapVector[PointerKeyboardPairingChangedNotify] = NotImplemented;
|
|
||||||
RestoreExtensionEvents();
|
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.
|
* IExtensionInit - initialize the input extension.
|
||||||
|
@ -1172,6 +1191,7 @@ XInputExtensionInit(void)
|
||||||
EventSwapVector[DeviceLeaveNotify] = SEventIDispatch;
|
EventSwapVector[DeviceLeaveNotify] = SEventIDispatch;
|
||||||
|
|
||||||
/* init GE events */
|
/* init GE events */
|
||||||
|
GERegisterExtension(IReqCode, XIGEEventSwap);
|
||||||
SetGenericFilter(IReqCode, xi_filters);
|
SetGenericFilter(IReqCode, xi_filters);
|
||||||
} else {
|
} else {
|
||||||
FatalError("IExtensionInit: AddExtensions failed\n");
|
FatalError("IExtensionInit: AddExtensions failed\n");
|
||||||
|
|
Loading…
Reference in New Issue