diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2007-01-10 14:53:44 +1030 |
---|---|---|
committer | Peter Hutterer <whot@hyena.localdomain> | 2007-01-10 14:53:44 +1030 |
commit | bfd533c3a7e854d893a06e6a7fe2b3f079508a4d (patch) | |
tree | 5e1ffafb263353db2eebbf2b74ad1a03f6627626 | |
parent | ebc24f1fad85281a1e9e795ec261eea111f40304 (diff) |
Adding DeviceEnterNotify and DeviceLeaveNotify calls
New XI version using Add_MPX_Major/Minor
-rw-r--r-- | Changelog | 21 | ||||
-rw-r--r-- | src/XExtInt.c | 23 | ||||
-rw-r--r-- | src/XExtToWire.c | 26 |
3 files changed, 48 insertions, 22 deletions
diff --git a/Changelog b/Changelog deleted file mode 100644 index 7d04f4e..0000000 --- a/Changelog +++ /dev/null @@ -1,21 +0,0 @@ -MPX Changelog - -== 07.01.07 == -Adding XDefineDeviceCursor and XUndefDeviceCursor calls -Fix casting typo in XWarpDevicePointer and XQueryDevicePointer -Reverting useless whitespace commit in XExtInt.c - -Files: - XDefDevCur.c - XQueryDvPtr.c - XWarpDvPtr.c - XExtInt.c - -== 20.12.06 == -Adding XWarpDevicePointer and XQueryDevicePointer calls. - -Files: - Makefile.am - XExtInt.c - XQueryDvPtr.c - XWarpDvPtr.c diff --git a/src/XExtInt.c b/src/XExtInt.c index 3d00e06..40a1eee 100644 --- a/src/XExtInt.c +++ b/src/XExtInt.c @@ -121,7 +121,8 @@ static XExtensionVersion versions[] = { {XI_Absent, 0, 0}, {XI_Present, XI_Add_XChangeDeviceControl_Major, XI_Add_XChangeDeviceControl_Minor}, {XI_Present, XI_Add_DevicePresenceNotify_Major, - XI_Add_DevicePresenceNotify_Minor} + XI_Add_DevicePresenceNotify_Minor}, +{XI_Present, XI_Add_MPX_Major, XI_Add_MPX_Minor} }; /*********************************************************************** @@ -697,6 +698,26 @@ XInputWireToEvent(dpy, re, event) } break; + case XI_DeviceEnterNotify: + case XI_DeviceLeaveNotify: + { + XDeviceCrossingEvent *ev = (XDeviceCrossingEvent*)re; + deviceEnterNotify *ev2 = (deviceEnterNotify*) event; + *ev = *(XDeviceCrossingEvent*)save; + ev->root = ev2->root; + ev->window = ev2->event; + ev->subwindow = ev2->child; + ev->time = ev2->time; + ev->x_root = ev2->rootX; + ev->y_root = ev2->rootY; + ev->x = ev2->eventX; + ev->y = ev2->eventY; + ev->state = ev2->state; + ev->mode = ev2->mode; + ev->deviceid = ev2->deviceid & DEVICE_BITS; + return (ENQUEUE_EVENT); + } + break; default: printf("XInputWireToEvent: UNKNOWN WIRE EVENT! type=%d\n", type); break; diff --git a/src/XExtToWire.c b/src/XExtToWire.c index 213da32..a93a811 100644 --- a/src/XExtToWire.c +++ b/src/XExtToWire.c @@ -454,6 +454,32 @@ _XiEventToWire(dpy, re, event, count) cev->deviceid = ev->deviceid; break; } + case XI_DeviceEnterNotify: + case XI_DeviceLeaveNotify: + { + register XDeviceCrossingEvent *ev = (XDeviceCrossingEvent*)re; + register deviceEnterNotify *elev; + + *count =1; + elev = (deviceEnterNotify *) Xmalloc(*count * sizeof(xEvent)); + if (!elev) + return (_XUnknownNativeEvent(dpy, re, *event)); + *event = (xEvent *) elev; + + elev->type = ev->type; + elev->deviceid = ev->deviceid; + elev->root = ev->root; + elev->event = ev->window; + elev->child = ev->subwindow; + elev->time = ev->time; + elev->eventX = ev->x; + elev->eventY = ev->y; + elev->rootX = ev->x_root; + elev->rootY = ev->y_root; + elev->state = ev->state; + elev->mode = ev->mode; + break; + } default: return (_XUnknownNativeEvent(dpy, re, *event)); } |