Commit fb4847d2 authored by Peter Hutterer's avatar Peter Hutterer

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=97117Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
parent ce85b11e
......@@ -2383,10 +2383,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);
......
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