diff options
author | Keith Packard <keithp@keithp.com> | 2016-05-30 01:27:49 -0700 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2016-05-31 07:35:44 +1000 |
commit | 157e0631b12d0aae4a5f38b81bee615a7eaf553f (patch) | |
tree | fffeb5a897bf245154ddfbd5472988148dfd90d7 | |
parent | 9ab899863a61b800d58e078e936c0d8d88bc0893 (diff) |
Use xf86AddEnabledDevice with threaded input
We didn't use SIGIO input for keyboard processing, but we can use
threaded input.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | src/kbd.c | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -45,6 +45,10 @@ #include "xkbstr.h" #include "xkbsrv.h" +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 23 +#define HAVE_THREADED_INPUT 1 +#endif + #define CAPSFLAG 1 #define NUMFLAG 2 #define SCROLLFLAG 4 @@ -352,7 +356,11 @@ KbdProc(DeviceIntPtr device, int what) */ if (pInfo->fd >= 0) { xf86FlushInput(pInfo->fd); +#if HAVE_THREADED_INPUT + xf86AddEnabledDevice(pInfo); +#else AddEnabledDevice(pInfo->fd); +#endif } device->public.on = TRUE; @@ -365,8 +373,13 @@ KbdProc(DeviceIntPtr device, int what) /* * Restore original keyboard directness and translation. */ - if (pInfo->fd != -1) + if (pInfo->fd != -1) { +#if HAVE_THREADED_INPUT + xf86RemoveEnabledDevice(pInfo); +#else RemoveEnabledDevice(pInfo->fd); +#endif + } pKbd->KbdOff(pInfo, what); device->public.on = FALSE; break; |