summaryrefslogtreecommitdiff
path: root/dix/devices.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2008-07-07 22:10:17 +0930
committerPeter Hutterer <peter.hutterer@who-t.net>2008-07-10 16:28:34 +0930
commit2039c6ea43244339659323d05d96c14e41996c20 (patch)
tree9f396ab16102d5b9199c439b39a087c8afd5247a /dix/devices.c
parent4ab01fe5db7fb330b1ec463aa49b77859527e597 (diff)
Xi: add support for input device properties.
Basically just copied from randr properties, with minor changes only. Each device supports arbitrary properties that can be modified by clients. Modifications to the properties are passed to the driver (if applicable) and can then affect the configuration of the device. Note that device properties are limited to a specific device. A property set on a slave device does not migrate to the master.
Diffstat (limited to 'dix/devices.c')
-rw-r--r--dix/devices.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/dix/devices.c b/dix/devices.c
index 0a68c0e61..df53613c3 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -83,6 +83,7 @@ SOFTWARE.
#include "exglobals.h"
#include "exevents.h"
#include "listdev.h" /* for CopySwapXXXClass */
+#include "xiproperty.h"
/** @file
* This file handles input device-related stuff.
@@ -173,6 +174,12 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart)
memset(dev->last.valuators, 0, sizeof(dev->last.valuators));
dev->last.numValuators = 0;
+ /* device properties */
+ dev->properties = NULL;
+ dev->SetProperty = NULL;
+ dev->GetProperty = NULL;
+ dev->pendingProperties = FALSE;
+
/* security creation/labeling check
*/
if (XaceHook(XACE_DEVICE_ACCESS, client, dev, DixCreateAccess)) {
@@ -770,6 +777,8 @@ CloseDevice(DeviceIntPtr dev)
if (!dev)
return;
+ XIDeleteAllDeviceProperties(dev);
+
if (dev->inited)
(void)(*dev->deviceProc)(dev, DEVICE_CLOSE);