summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@redhat.com>2008-10-14 15:30:20 +1030
committerPeter Hutterer <peter.hutterer@redhat.com>2008-10-14 15:30:20 +1030
commitff783fce65a63707555098759692b22147646263 (patch)
tree16ba0a4ea081113fbe6a7f673218abf826520cc2 /src
parentc638aa4a88116a1219cf4941aacd630e070db099 (diff)
Add property support for ReopenAttempts option.
Diffstat (limited to 'src')
-rw-r--r--src/evdev.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/evdev.c b/src/evdev.c
index d6848ff..46880a5 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -105,6 +105,7 @@ static void EvdevInitProperty(DeviceIntPtr dev);
static int EvdevSetProperty(DeviceIntPtr dev, Atom atom,
XIPropertyValuePtr val, BOOL checkonly);
static Atom prop_invert = 0;
+static Atom prop_reopen = 0;
#endif
@@ -1467,6 +1468,7 @@ EvdevInitProperty(DeviceIntPtr dev)
EvdevPtr pEvdev = pInfo->private;
int rc;
BOOL invert[2];
+ char reopen;
invert[0] = pEvdev->invert_x;
invert[1] = pEvdev->invert_y;
@@ -1480,6 +1482,17 @@ EvdevInitProperty(DeviceIntPtr dev)
return;
XISetDevicePropertyDeletable(dev, prop_invert, FALSE);
+
+ prop_reopen = MakeAtom(EVDEV_PROP_REOPEN, strlen(EVDEV_PROP_REOPEN),
+ TRUE);
+
+ reopen = pEvdev->reopen_attempts;
+ rc = XIChangeDeviceProperty(dev, prop_reopen, XA_INTEGER, 8,
+ PropModeReplace, 1, &reopen, FALSE);
+ if (rc != Success)
+ return;
+
+ XISetDevicePropertyDeletable(dev, prop_reopen, FALSE);
}
static int
@@ -1501,6 +1514,13 @@ EvdevSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
pEvdev->invert_x = data[0];
pEvdev->invert_y = data[1];
}
+ } else if (atom == prop_reopen)
+ {
+ if (val->format != 8 || val->size != 1 || val->type != XA_INTEGER)
+ return BadMatch;
+
+ if (!checkonly)
+ pEvdev->reopen_attempts = *((CARD8*)val->data);
}
return Success;