summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2016-08-03 15:48:58 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2016-08-12 11:34:35 +1000
commitfb4847d243321cb400b9abbb1f04eb8566c8cf8e (patch)
treec10f32776a754080e675678b03ff32359a415336 /src
parentce85b11e4c211da3b3fe1b6803498c96065c2598 (diff)
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 <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/xf86libinput.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/xf86libinput.c b/src/xf86libinput.c
index 45385f7..7ed25dc 100644
--- a/src/xf86libinput.c
+++ b/src/xf86libinput.c
@@ -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);