[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#437273: xserver-xorg-input-synaptics: Synaptics touchpad doesn't work on 'switch user'



On Sat, 11 Aug 2007, Mattia Dongili wrote:

On Sat, Aug 11, 2007 at 12:40:55PM +0100, Neil Wilson wrote:
Package: xserver-xorg-input-synaptics
Version: 0.14.6-0ubuntu7
Severity: normal
Tags: patch
...
Running Ubuntu - fault in versions for Feisty and Gutsy. Fault also
exists in current Debian release.

After a 'switch user' on the console, the mouse locks for the second
user. This is because the software does not release the console mouse on
switch.

patch attached.

Ubuntu bug is https://bugs.launchpad.net/bugs/68370

diff -ur xserver-xorg-input-synaptics-0.14.6/eventcomm.c xserver-xorg-input-synaptics-0.14.6-ds/eventcomm.c
--- xserver-xorg-input-synaptics-0.14.6/eventcomm.c	2007-07-09 19:42:55.000000000 -0700
+++ xserver-xorg-input-synaptics-0.14.6-ds/eventcomm.c	2007-07-09 19:11:03.000000000 -0700
@@ -56,6 +56,12 @@
 static void
 EventDeviceOffHook(LocalDevicePtr local)
 {
+    int ret;

in the debian version (that'a git snapshot) you'll need to look at
grab_event_parameter (it doesn't hurt)

+    SYSCALL(ret = ioctl(local->fd, EVIOCGRAB, (pointer)1));

and maybe you want to pass 0 as parameter.

+    if (ret < 0) {
+	xf86Msg(X_WARNING, "%s can't ungrab event device, errno=%d\n",
+		local->name, errno);
+    }
 }

Anyway, Peter does this make sense to you?

Unfortunately it doesn't, because the synaptics driver closes the event device anyway in the DeviceOff function. Closing the device will cause an automatic ungrab, so the patch at best only changes the timings. Maybe a wait-and-retry loop in EventDeviceOnHook would help.

I think what happens is that the driver running in the second X server tries to grab the device before the driver in the first X server has released it. I don't know if the X server is supposed to synchronize this somehow, or if it is up to the synaptics driver to deal with the situation.

The latest git version has an option GrabEventDevice that can be set to false to bypass the grab/ungrab. This would probably help, except that it doesn't work well if the X config file also uses /dev/input/mice. (Which most configs do.)

--
Peter Osterlund - petero2@telia.com
http://web.telia.com/~u89404340



Reply to: