summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2008-07-09 16:54:32 +0930
committerPeter Hutterer <peter.hutterer@who-t.net>2008-07-09 17:51:27 +0930
commit0211e3e8277c590349903989f1676f6af4baa44b (patch)
treebef8f31d29aa3975ba45da0850994ab1449f98b0
parent7d5bb99ffce3200f82420c5a5ebac3b445aac633 (diff)
Add XDevicePropertyNotifyEvent support.
-rw-r--r--include/X11/extensions/XInput.h17
-rw-r--r--src/XExtInt.c17
2 files changed, 34 insertions, 0 deletions
diff --git a/include/X11/extensions/XInput.h b/include/X11/extensions/XInput.h
index 93c9041..d2b845f 100644
--- a/include/X11/extensions/XInput.h
+++ b/include/X11/extensions/XInput.h
@@ -530,6 +530,23 @@ typedef struct {
XAnyClassPtr inputclassinfo; /* same as in XDeviceInfo */
} XDeviceClassesChangedEvent;
+/*
+ * Notifies the client that a property on a device has changed value. The
+ * client is expected to query the server for updated value of the property.
+ */
+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; /* XI_DeviceHierarchyChangedNotify */
+ Time time;
+ XID deviceid; /* id of the device that changed */
+ Atom atom; /* the property that changed */
+ int state; /* PropertyNewValue or PropertyDeleted */
+} XDevicePropertyNotifyEvent;
+
/*******************************************************************
*
diff --git a/src/XExtInt.c b/src/XExtInt.c
index 5052b7f..2323ce8 100644
--- a/src/XExtInt.c
+++ b/src/XExtInt.c
@@ -849,6 +849,23 @@ XInputWireToEvent(
*re = *save;
return ENQUEUE_EVENT;
}
+ case XI_DevicePropertyNotify:
+ {
+ XDevicePropertyNotifyEvent* dpn_event =
+ (XDevicePropertyNotifyEvent*)save;
+ devicePropertyNotifyEvent* dpn_wire =
+ (devicePropertyNotifyEvent*)event;
+
+ dpn_event->extension = dpn_wire->extension;
+ dpn_event->evtype = dpn_wire->evtype;
+ dpn_event->time = dpn_wire->time;
+ dpn_event->deviceid = dpn_wire->deviceid;
+ dpn_event->atom = dpn_wire->atom;
+ dpn_event->state = dpn_wire->state;
+
+ *re = *save;
+ return ENQUEUE_EVENT;
+ }
default:
printf("XInputWireToEvent: Unknown generic event. type %d\n", ge->evtype);