diff options
author | Peter Hutterer <peter.hutterer@redhat.com> | 2008-10-14 15:30:20 +1030 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@redhat.com> | 2008-10-14 17:18:07 +1030 |
commit | 4f80c0f2cb77b9a51ab27577c318469f7eaf1e15 (patch) | |
tree | cc1fcb4992f36fa6926b9e659a68cde40983cdb6 /src | |
parent | 5070d64aa85f9bf137836ad46b3da9581e139a1a (diff) |
Add property support for ReopenAttempts option.
(cherry picked from commit ff783fce65a63707555098759692b22147646263)
Diffstat (limited to 'src')
-rw-r--r-- | src/evdev.c | 20 |
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; |