[PATCH synaptic 2/2] config: don't autoprobe when device was set

Chase Douglas chase.douglas at canonical.com
Wed Sep 22 21:32:39 PDT 2010


On Sun, 2010-09-19 at 09:49 +0200, Giuseppe Bilotta wrote:
> If device was already set, we were asked to handle that specific device
> and we should not go probing around. If we do, we might end up handling
> a device different from what the X server thinks we are handling, with
> dire consequences in case of hot plugging and unplugging.
> 
> Without this patch, a situation such as the following can happen.
> 
> A user has both a built-in laptop touchpad and a tablet such as the
> Wacom Bamboo Pen & Touch, that is also exposed as a touchpad.
> 
> The tablet is plugged in before the server starts, and during setup the
> server calls the synaptic driver for the /dev/input/mouseX device
> corresponding to the touch device of the tablet; we end up in the
> autoprobe path even though `device' was set, and the driver scans
> /dev/input, where the first useful device it finds is the event device
> for the built-in touchpad.
> 
> The driver starts managing the built-in touchpad, preventing future
> instances from managing it too, while the server thinks the driver is
> managing the tablet.
> 
> When the user disconnects the tablet, the corresponding instance of the
> synpatics driver (which is actually managing the touchpad instead) is
> unloaded: the built-in touchpad stops working in X.
> 
> Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta at gmail.com>
> ---
>  src/synaptics.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/src/synaptics.c b/src/synaptics.c
> index 89398f5..e0b93a0 100644
> --- a/src/synaptics.c
> +++ b/src/synaptics.c
> @@ -275,7 +275,7 @@ SetDeviceAndProtocol(InputInfoPtr pInfo)
>  	    proto = SYN_PROTO_ALPS;
>  	} else { /* default to auto-dev */
>  #ifdef BUILD_EVENTCOMM
> -	    if (event_proto_operations.AutoDevProbe(pInfo))
> +	    if (!device && event_proto_operations.AutoDevProbe(pInfo))
>  		proto = SYN_PROTO_EVENT;
>  #endif
>  	}

We hit this issue in Ubuntu and resolved it in Maverick using a
MatchDevicePath option in the synaptics xorg.conf.d file. Last week at
XDS I chatted with Peter and we decided the approach your patch above
takes would be best. You happened to beat me to the punch with your
patch :).

Reviewed-by: Chase Douglas <chase.douglas at canonical.com>

Thanks!



More information about the xorg-devel mailing list