diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-01-22 15:20:05 +1100 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-01-22 15:20:05 +1100 |
commit | ac421e536cdc08e24cc651a0806871df0dc589b0 (patch) | |
tree | 2dd0ae23884cbdfeab706b76f6a8c6c8fb2cda4f /src/evdev.c | |
parent | Don't print xkb options twice to the log file. (diff) | |
download | xf86-input-evdev-ac421e536cdc08e24cc651a0806871df0dc589b0.tar.gz xf86-input-evdev-ac421e536cdc08e24cc651a0806871df0dc589b0.tar.bz2 xf86-input-evdev-ac421e536cdc08e24cc651a0806871df0dc589b0.zip |
Reshuffle property initialization.
We don't need axis calibration, etc. on keyboards, so let's do it
conditionally on actually having axes.
Reported by Simon Thum.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 1906e4d5c112c25c9d7a736d4924d1005267aba7)
Conflicts:
src/evdev.c
Diffstat (limited to 'src/evdev.c')
-rw-r--r-- | src/evdev.c | 51 |
1 files changed, 25 insertions, 26 deletions
diff --git a/src/evdev.c b/src/evdev.c index 6eaaaca..bdf7592 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -1649,6 +1649,16 @@ EvdevInitProperty(DeviceIntPtr dev) BOOL invert[2]; char reopen; + 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); if (pEvdev->flags & (EVDEV_RELATIVE_EVENTS | EVDEV_ABSOLUTE_EVENTS)) { @@ -1664,38 +1674,27 @@ 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; + prop_calibration = MakeAtom(EVDEV_PROP_CALIBRATION, + strlen(EVDEV_PROP_CALIBRATION), TRUE); + rc = XIChangeDeviceProperty(dev, prop_calibration, XA_INTEGER, 32, + PropModeReplace, 0, NULL, FALSE); + if (rc != Success) + return; - XISetDevicePropertyDeletable(dev, prop_reopen, FALSE); + XISetDevicePropertyDeletable(dev, prop_calibration, FALSE); + prop_swap = MakeAtom(EVDEV_PROP_SWAP_AXES, + strlen(EVDEV_PROP_SWAP_AXES), TRUE); - prop_calibration = MakeAtom(EVDEV_PROP_CALIBRATION, - strlen(EVDEV_PROP_CALIBRATION), TRUE); - rc = XIChangeDeviceProperty(dev, prop_calibration, XA_INTEGER, 32, - PropModeReplace, 0, NULL, FALSE); - if (rc != Success) - return; - - XISetDevicePropertyDeletable(dev, prop_calibration, FALSE); + rc = XIChangeDeviceProperty(dev, prop_swap, XA_INTEGER, 8, + PropModeReplace, 1, &pEvdev->swap_axes, FALSE); + if (rc != Success) + return; - prop_swap = MakeAtom(EVDEV_PROP_SWAP_AXES, - strlen(EVDEV_PROP_SWAP_AXES), TRUE); + XISetDevicePropertyDeletable(dev, prop_swap, FALSE); - rc = XIChangeDeviceProperty(dev, prop_swap, XA_INTEGER, 8, - PropModeReplace, 1, &pEvdev->swap_axes, FALSE); - if (rc != Success) - return; - - XISetDevicePropertyDeletable(dev, prop_swap, FALSE); + } } static int |