Commit 289de5be authored by Keith Packard's avatar Keith Packard Committed by Peter Hutterer

Use xf86AddEnabledDevice instead of AddEnabledDevice when threaded [v3]

libinput can't run at SIGIO time, so it has been using
AddEnabledDevice to run in non-signal context.

Threaded input runs all input in non-signal context, so we want to use
xf86AddEnabledDevice at last.

v2: use XINPUT ABI version check instead of testing for presence of
    AddEnabledDevice, which can't get removed from the server until
    a few more patches past the threaded input change are merged.

v3: remove reference to XI86_SIGNAL_IO, which was presumably
    a planned change to the xf86AddEnabledDevice path to make that
    not use SIGIO.
Signed-off-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
Tested-by: Michel Dänzer's avatarMichel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent ceea2bb8
......@@ -55,6 +55,10 @@
#undef HAVE_VMASK_UNACCEL
#endif
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 23
#define HAVE_THREADED_INPUT 1
#endif
#define TOUCHPAD_NUM_AXES 4 /* x, y, hscroll, vscroll */
#define TABLET_NUM_BUTTONS 7 /* we need scroll buttons */
#define TOUCH_MAX_SLOTS 15
......@@ -522,8 +526,12 @@ xf86libinput_on(DeviceIntPtr dev)
pInfo->fd = libinput_get_fd(libinput);
if (driver_context.device_enabled_count == 0) {
#if HAVE_THREADED_INPUT
xf86AddEnabledDevice(pInfo);
#else
/* Can't use xf86AddEnabledDevice on an epollfd */
AddEnabledDevice(pInfo->fd);
#endif
}
driver_context.device_enabled_count++;
......@@ -542,7 +550,11 @@ xf86libinput_off(DeviceIntPtr dev)
struct xf86libinput_device *shared_device = driver_data->shared_device;
if (--driver_context.device_enabled_count == 0) {
#if HAVE_THREADED_INPUT
xf86RemoveEnabledDevice(pInfo);
#else
RemoveEnabledDevice(pInfo->fd);
#endif
}
if (use_server_fd(pInfo)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment