diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-02-23 16:14:51 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-03-20 15:17:55 +1000 |
commit | 181e41511d5772962b8bc998a1940d2a9ba62d5e (patch) | |
tree | 19f371099aa7cab86980e49308806c455c511188 /Xi/extinit.c | |
parent | 0befeb36c175b14eac8d5416851f1556af90dd86 (diff) |
dix: fix up device enter/leave for XI_Enter/XI_Leave.
Diffstat (limited to 'Xi/extinit.c')
-rw-r--r-- | Xi/extinit.c | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/Xi/extinit.c b/Xi/extinit.c index 9acbdfe45..8452186a5 100644 --- a/Xi/extinit.c +++ b/Xi/extinit.c @@ -602,20 +602,28 @@ SDevicePropertyNotifyEvent (devicePropertyNotify *from, devicePropertyNotify *to } static void -SDeviceLeaveNotifyEvent (deviceLeaveNotify *from, deviceLeaveNotify *to) +SDeviceLeaveNotifyEvent (xXILeaveEvent *from, xXILeaveEvent *to) { char n; *to = *from; swaps(&to->sequenceNumber,n); + swapl(&to->length, n); + swaps(&to->evtype, n); + swaps(&to->deviceid, 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); + swaps(&to->root_x.integral, n); + swaps(&to->root_x.frac, n); + swaps(&to->root_y.integral, n); + swaps(&to->root_y.frac, n); + swaps(&to->event_x.integral, n); + swaps(&to->event_x.frac, n); + swaps(&to->event_y.integral, n); + swaps(&to->event_y.frac, n); + swaps(&to->sourceid, n); } static void @@ -669,6 +677,13 @@ SDeviceClassesChangedEvent(deviceClassesChangedEvent* from, static void XI2EventSwap(xGenericEvent *from, xGenericEvent *to) { + switch(from->evtype) + { + case XI_Enter: + case XI_Leave: + SDeviceLeaveNotifyEvent((xXILeaveEvent*)from, (xXILeaveEvent*)to); + break; + } } /************************************************************************** @@ -1025,10 +1040,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"); } @@ -1084,8 +1095,6 @@ XInputExtensionInit(void) EventSwapVector[DeviceMappingNotify] = SEventIDispatch; EventSwapVector[ChangeDeviceNotify] = SEventIDispatch; EventSwapVector[DevicePresenceNotify] = SEventIDispatch; - EventSwapVector[DeviceEnterNotify] = SEventIDispatch; - EventSwapVector[DeviceLeaveNotify] = SEventIDispatch; GERegisterExtension(IReqCode, XI2EventSwap); } else { |