From f1948e08ee9894864254a18098e4f4fceb6e322f Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 19 Mar 2014 15:08:15 +1000 Subject: Disable GrabEventDevice by default This was required when we started supporting hotplugging to avoid duplicate events. These days the drawback of not being able to record events in the case of a bug is significant. Check the configuration source on init. If the device was hotplugged through a a server config backend, disable the grab. If the device was statically configured through an xorg.conf then leave the default grab enabled to avoid a duplicate device. Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede --- src/synaptics.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/synaptics.c b/src/synaptics.c index 07fd450..f4c1d4a 100644 --- a/src/synaptics.c +++ b/src/synaptics.c @@ -576,6 +576,8 @@ set_default_parameters(InputInfoPtr pInfo) int width, height, diag, range; int horizHyst, vertHyst; int middle_button_timeout; + int grab_event_device = 0; + const char *source; /* The synaptics specs specify typical edge widths of 4% on x, and 5.4% on * y (page 7) [Synaptics TouchPad Interfacing Guide, 510-000080 - A @@ -747,7 +749,16 @@ set_default_parameters(InputInfoPtr pInfo) xf86SetRealOption(opts, "PressureMotionMinFactor", 1.0); pars->press_motion_max_factor = xf86SetRealOption(opts, "PressureMotionMaxFactor", 1.0); - pars->grab_event_device = xf86SetBoolOption(opts, "GrabEventDevice", TRUE); + + /* Only grab the device by default if it's not coming from a config + backend. This way we avoid the device being added twice and sending + duplicate events. + */ + source = xf86CheckStrOption(opts, "_source", NULL); + if (source == NULL || strncmp(source, "server/", 7) != 0) + grab_event_device = TRUE; + pars->grab_event_device = xf86SetBoolOption(opts, "GrabEventDevice", grab_event_device); + pars->tap_and_drag_gesture = xf86SetBoolOption(opts, "TapAndDragGesture", TRUE); pars->resolution_horiz = -- cgit v1.2.3