From f48ebc05978b0c8c4448901ddf57ccf31e757244 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 3 Aug 2016 15:48:58 +1000 Subject: [PATCH xf86-input-libinput] Block input events while creating the virtual subdevices If an event comes in halfway through the new device creation we read it from libinput's epollfd but depending on the setup stage the new device may not be ready yet. https://bugs.freedesktop.org/show_bug.cgi?id=97117 Signed-off-by: Peter Hutterer --- src/xf86libinput.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/xf86libinput.c b/src/xf86libinput.c index fff59b3..5873e45 100644 --- a/src/xf86libinput.c +++ b/src/xf86libinput.c @@ -2394,10 +2394,20 @@ xf86libinput_hotplug_device(struct xf86libinput_hotplug_info *hotplug) { DeviceIntPtr dev; +#if HAVE_THREADED_INPUT + input_lock(); +#else + int sigstate = xf86BlockSIGIO(); +#endif if (NewInputDeviceRequest(hotplug->input_options, hotplug->attrs, &dev) != Success) dev = NULL; +#if HAVE_THREADED_INPUT + input_unlock(); +#else + xf86UnblockSIGIO(sigstate); +#endif input_option_free_list(&hotplug->input_options); FreeInputAttributes(hotplug->attrs); -- 2.7.4