From 130774c208a2f331d6110b255676ad6cb8a1a414 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 7 May 2009 11:02:02 +1000 Subject: Add property event conversion. --- include/X11/extensions/XInput2.h | 13 +++++++++++++ src/XExtInt.c | 25 +++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/include/X11/extensions/XInput2.h b/include/X11/extensions/XInput2.h index 77dd57b..abef3f2 100644 --- a/include/X11/extensions/XInput2.h +++ b/include/X11/extensions/XInput2.h @@ -263,6 +263,19 @@ typedef struct { typedef XIEnterEvent XILeaveEvent; + +typedef struct { + int type; /* GenericEvent */ + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + int extension; /* XI extension offset */ + int evtype; + Time time; + Atom property; + int what; +} XIPropertyEvent; + _XFUNCPROTOBEGIN extern Bool XIQueryDevicePointer( diff --git a/src/XExtInt.c b/src/XExtInt.c index fc018cd..1d12061 100644 --- a/src/XExtInt.c +++ b/src/XExtInt.c @@ -135,6 +135,8 @@ static int wireToRawEvent(xXIRawDeviceEvent *in, XIRawDeviceEvent *out); static int wireToEnterLeave(xXIEnterEvent *in, XIEnterEvent *out); +static int +wireToPropertyEvent(xXIPropertyEvent *in, XIPropertyEvent *out); static /* const */ XEvent emptyevent; @@ -847,6 +849,16 @@ XInputWireToEvent( break; } return ENQUEUE_EVENT; + case XI_PropertyEvent: + *re = *save; + if (!wireToPropertyEvent((xXIPropertyEvent*)event, + (XIPropertyEvent*)re)) + { + printf("XInputWireToEvent: CONVERSION FAILURE! evtype=%d\n", + ge->evtype); + break; + } + return ENQUEUE_EVENT; default: printf("XInputWireToEvent: Unknown generic event. type %d\n", ge->evtype); @@ -1059,3 +1071,16 @@ wireToEnterLeave(xXIEnterEvent *in, XIEnterEvent *out) return 1; } + +static int +wireToPropertyEvent(xXIPropertyEvent *in, XIPropertyEvent *out) +{ + out->type = in->type; + out->extension = in->extension; + out->evtype = in->evtype; + out->time = in->time; + out->property = in->property; + out->what = in->what; + + return 1; +} -- cgit v1.2.3