[PATCH xf86-input-keyboard] Use xf86AddEnabledDevice with threaded input
Peter Hutterer
peter.hutterer at who-t.net
Mon May 30 22:26:50 UTC 2016
On Mon, May 30, 2016 at 01:27:49AM -0700, Keith Packard wrote:
> We couldn't use SIGIO input for keyboard processing, but we can use
> threaded input.
s/couldn't/didn't/
>
> Signed-off-by: Keith Packard <keithp at keithp.com>
> ---
> src/kbd.c | 16 +++++++++++++++-
> 1 file changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/src/kbd.c b/src/kbd.c
> index e378dcc..3063d27 100644
> --- a/src/kbd.c
> +++ b/src/kbd.c
> @@ -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,12 @@ KbdProc(DeviceIntPtr device, int what)
> */
> if (pInfo->fd >= 0) {
> xf86FlushInput(pInfo->fd);
> +#if HAVE_THREADED_INPUT
> + xf86AddEnabledDevice(pInfo);
> +#else
> + /* Can't use xf86AddEnabledDevice on an epollfd */
this is from libinput, I removed this line
9ab8998..157e063 master -> master
thanks.
Cheers,
Peter
> AddEnabledDevice(pInfo->fd);
> +#endif
> }
>
> device->public.on = TRUE;
> @@ -365,8 +374,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;
> --
> 2.8.1
>
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: https://lists.x.org/mailman/listinfo/xorg-devel
>
More information about the xorg-devel
mailing list