summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2014-03-19 15:08:15 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2014-03-24 09:15:25 +1000
commitf1948e08ee9894864254a18098e4f4fceb6e322f (patch)
treee86ce27aae81a0b05520ae79f9ee18106b0fd337
parentfd709900445e3cb9f31ce7e780bfa98ecb6dab9b (diff)
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 <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--src/synaptics.c13
1 files changed, 12 insertions, 1 deletions
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 =