GNOME Bugzilla – Bug 784266
detection of synaptics does not seem to work
Last modified: 2018-02-12 19:32:41 UTC
Debian unstable, gnome-control-center 3.22.2 If I have xserver-xorg-input-synaptics installed, the mouse panel does not show the touchpad section. So this works as expected. What's unexpected though is, that I do not get any warning on the console. gnome-control-center is supposed to log a warning message, but afaics cc_synaptics_check() does not properly detect the existence of a synaptics touchpad. This is a follow-up to https://bugzilla.gnome.org/show_bug.cgi?id=743266
I think it would be useful to show users a GUI warning too. It's not pratical to expect that distros will not make the Synaptics driver (especially since some desktops aren't ready for libinput yet). As of -synaptics 1.9.0, the Synaptics driver is used instead of libinput if the Synaptics driver is installed, so this problem is not the fault of distros. https://cgit.freedesktop.org/xorg/driver/xf86-input-synaptics/commit/?id=59e5db025
I can't easily test this. Does the following diff make it work? diff --git a/panels/mouse/cc-mouse-caps-helper.c b/panels/mouse/cc-mouse-caps-helper.c index 3b912ce..b4c0dd5 100644 --- a/panels/mouse/cc-mouse-caps-helper.c +++ b/panels/mouse/cc-mouse-caps-helper.c @@ -117,7 +117,7 @@ cc_synaptics_check (void) return FALSE; display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()); - prop = XInternAtom (display, "Synaptics Capabilities", False); + prop = XInternAtom (display, "Synaptics Off", False); gdk_error_trap_push (); @@ -129,7 +129,7 @@ cc_synaptics_check (void) continue; if ((XIGetProperty (display, gdk_x11_device_get_id (device), prop, - 0, 2, False, XA_INTEGER, &realtype, &realformat, &nitems, + 0, 1, False, XA_INTEGER, &realtype, &realformat, &nitems, &bytes_after, &data) == Success) && (realtype != None)) { have_synaptics = TRUE; XFree (data);
@Rui, tried the patch but it didn't make a difference, i.e. no warning message is logged when xserver-xorg-input-synaptics is installed and active.
Hmm, then I'm afraid gdk_seat_get_slaves() isn't returning the device at all. Can you run g-c-c under gdb, break on cc_synaptics_check(), step through the for loop and check if you ever get a GDK_SOURCE_TOUCHPAD device?
I do get a GDK_SOURCE_TOUCHPAD device, but if ((XIGetProperty (display, gdk_x11_device_get_id (device), prop, 0, 1, False, XA_INTEGER, &realtype, &realformat, &nitems, &bytes_after, &data) == Success) && (realtype != None)) { does not evaluate to true. realtype is set to 32, but XIGetProperty does not return Success
Somehow ddd was playing tricks on me. Rerunning it a again and explicitly logging the GdkInputSource, I get GDK_SOURCE_MOUSE and GDK_SOURCE_TRACKPOINT. Is the synaptics touchpad misdetected as mouse input?
$ xinput list ⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ Logitech USB Optical Mouse id=9 [slave pointer (2)] ⎜ ↳ Microsoft Natural® Ergonomic Keyboard 4000 id=11 [slave pointer (2)] ⎜ ↳ SynPS/2 Synaptics TouchPad id=14 [slave pointer (2)] ⎜ ↳ TPPS/2 IBM TrackPoint id=15 [slave pointer (2)] ⎣ Virtual core keyboard id=3 [master keyboard (2)] ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] ↳ Power Button id=6 [slave keyboard (3)] ↳ Video Bus id=7 [slave keyboard (3)] ↳ Sleep Button id=8 [slave keyboard (3)] ↳ Microsoft Natural® Ergonomic Keyboard 4000 id=10 [slave keyboard (3)] ↳ Integrated Camera id=12 [slave keyboard (3)] ↳ AT Translated Set 2 keyboard id=13 [slave keyboard (3)] ↳ ThinkPad Extra Buttons id=16 [slave keyboard (3)] ↳ Microsoft Natural® Ergonomic Keyboard 4000 id=17 [slave keyboard (3)] $ xinput list 14 SynPS/2 Synaptics TouchPad id=14 [slave pointer (2)] Reporting 8 classes: Class originated from: 14. Type: XIButtonClass Buttons supported: 12 Button labels: "Button Left" "Button Middle" "Button Right" "Button Wheel Up" "Button Wheel Down" "Button Horiz Wheel Left" "Button Horiz Wheel Right" None None None None None Button state: Class originated from: 14. Type: XIValuatorClass Detail for Valuator 0: Label: Rel X Range: 1316.000000 - 5627.000000 Resolution: 58000 units/m Mode: relative Class originated from: 14. Type: XIValuatorClass Detail for Valuator 1: Label: Rel Y Range: 1355.000000 - 4826.000000 Resolution: 81000 units/m Mode: relative Class originated from: 14. Type: XIValuatorClass Detail for Valuator 2: Label: Rel Horiz Scroll Range: 0.000000 - -1.000000 Resolution: 0 units/m Mode: relative Class originated from: 14. Type: XIValuatorClass Detail for Valuator 3: Label: Rel Vert Scroll Range: 0.000000 - -1.000000 Resolution: 0 units/m Mode: relative Class originated from: 14. Type: XIValuatorClass Detail for Valuator 4: Label: Abs MT Pressure Range: -1.000000 - -1.000000 Resolution: 0 units/m Mode: relative Class originated from: 14. Type: XIScrollClass Scroll info for Valuator 2 type: 2 (horizontal) increment: 110.000000 flags: 0x0 Class originated from: 14. Type: XIScrollClass Scroll info for Valuator 3 type: 1 (vertical) increment: 110.000000 flags: 0x0 excerpt from the journal: Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: (II) config/udev: Adding input device SynPS/2 Synaptics TouchPad (/dev/input/event1) Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: (**) SynPS/2 Synaptics TouchPad: Applying InputClass "evdev touchpad catchall" Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: (**) SynPS/2 Synaptics TouchPad: Applying InputClass "libinput touchpad catchall" Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: (**) SynPS/2 Synaptics TouchPad: Applying InputClass "touchpad catchall" Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: (**) SynPS/2 Synaptics TouchPad: Applying InputClass "Default clickpad buttons" Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: (II) LoadModule: "synaptics" Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: (II) Loading /usr/lib/xorg/modules/input/synaptics_drv.so Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: (II) Module synaptics: vendor="X.Org Foundation" Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: compiled for 1.19.0, module version = 1.9.0 Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: Module class: X.Org XInput Driver Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: ABI class: X.Org XInput driver, version 24.1 Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: (II) Using input driver 'synaptics' for 'SynPS/2 Synaptics TouchPad' Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: (II) systemd-logind: got fd for /dev/input/event1 13:65 fd 31 paused 0 Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: (**) SynPS/2 Synaptics TouchPad: always reports core events Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: (**) Option "Device" "/dev/input/event1" Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: (II) synaptics: SynPS/2 Synaptics TouchPad: found clickpad property Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: (--) synaptics: SynPS/2 Synaptics TouchPad: x-axis range 1316 - 5627 (res 58) Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: (--) synaptics: SynPS/2 Synaptics TouchPad: y-axis range 1355 - 4826 (res 81) Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: (--) synaptics: SynPS/2 Synaptics TouchPad: pressure range 0 - 255 Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: (--) synaptics: SynPS/2 Synaptics TouchPad: finger width range 0 - 15 Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: (--) synaptics: SynPS/2 Synaptics TouchPad: buttons: left double triple Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: (--) synaptics: SynPS/2 Synaptics TouchPad: Vendor 0x2 Product 0x7 Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: (**) Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0" Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: (--) synaptics: SynPS/2 Synaptics TouchPad: touchpad found Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: (**) SynPS/2 Synaptics TouchPad: always reports core events Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: (**) Option "config_info" "udev:/sys/devices/platform/i8042/serio1/input/input2/event1" Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: (II) XINPUT: Adding extended input device "SynPS/2 Synaptics TouchPad" (type: TOUCHPAD, id 14) Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: (**) synaptics: SynPS/2 Synaptics TouchPad: (accel) MinSpeed is now constant deceleration 2.5 Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: (**) synaptics: SynPS/2 Synaptics TouchPad: (accel) MaxSpeed is now 1.75 Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: (**) synaptics: SynPS/2 Synaptics TouchPad: (accel) AccelFactor is now 0.036 Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: (**) SynPS/2 Synaptics TouchPad: (accel) keeping acceleration scheme 1 Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: (**) SynPS/2 Synaptics TouchPad: (accel) acceleration profile 1 Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: (**) SynPS/2 Synaptics TouchPad: (accel) acceleration factor: 2.000 Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: (**) SynPS/2 Synaptics TouchPad: (accel) acceleration threshold: 4 Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: (--) synaptics: SynPS/2 Synaptics TouchPad: touchpad found Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: (II) config/udev: Adding input device SynPS/2 Synaptics TouchPad (/dev/input/mouse0) Jul 07 13:23:08 pluto /usr/lib/gdm3/gdm-x-session[1799]: (**) SynPS/2 Synaptics TouchPad: Ignoring device from InputClass "touchpad ignore duplicates"
Ok, I guess gdk isn't setting the source type correctly for synaptics devices. Doesn't really matter here. We can drop that condition since it's enough for us to know if any pointing device is being driven by synaptics. Does the following work? diff --git a/panels/mouse/cc-mouse-caps-helper.c b/panels/mouse/cc-mouse-caps-helper.c index 3b912ce..65e11df 100644 --- a/panels/mouse/cc-mouse-caps-helper.c +++ b/panels/mouse/cc-mouse-caps-helper.c @@ -125,8 +125,6 @@ cc_synaptics_check (void) GDK_SEAT_CAPABILITY_ALL_POINTING); for (l = devicelist; l != NULL; l = l->next) { GdkDevice *device = l->data; - if (gdk_device_get_source (device) != GDK_SOURCE_TOUCHPAD) - continue; if ((XIGetProperty (display, gdk_x11_device_get_id (device), prop, 0, 2, False, XA_INTEGER, &realtype, &realformat, &nitems,
(In reply to Rui Matos from comment #8) > Ok, I guess gdk isn't setting the source type correctly for synaptics > devices. > > Doesn't really matter here. We can drop that condition since it's enough for > us to know if any pointing device is being driven by synaptics. Does the > following work? > > diff --git a/panels/mouse/cc-mouse-caps-helper.c > b/panels/mouse/cc-mouse-caps-helper.c > index 3b912ce..65e11df 100644 > --- a/panels/mouse/cc-mouse-caps-helper.c > +++ b/panels/mouse/cc-mouse-caps-helper.c > @@ -125,8 +125,6 @@ cc_synaptics_check (void) > GDK_SEAT_CAPABILITY_ALL_POINTING); > for (l = devicelist; l != NULL; l = l->next) { > GdkDevice *device = l->data; > - if (gdk_device_get_source (device) != GDK_SOURCE_TOUCHPAD) > - continue; > > if ((XIGetProperty (display, gdk_x11_device_get_id > (device), prop, > 0, 2, False, XA_INTEGER, &realtype, > &realformat, &nitems, Yep, this works. With xserver-xorg-input-synaptics installed I now get the warning and no warning if uninstalled. Btw, what do you think about Jeremy's idea to make this warning more prominent, e.g. by adding a Gtk label? This way it wouldn't be so easily missed.
Created attachment 355092 [details] [review] mouse: Fix synaptics check It seems like (at least some versions of) gdk don't set GDK_SOURCE_TOUCHPAD on synaptics devices. In this case though, we don't need the additional check. Just knowing if there's any device being driven by this X driver is enough.
(In reply to Michael Biebl from comment #9) > Btw, what do you think about Jeremy's idea to make this warning more > prominent, e.g. by adding a Gtk label? This way it wouldn't be so easily > missed. I'll review a patch to do it :-)
(In reply to Rui Matos from comment #11) > (In reply to Michael Biebl from comment #9) > > Btw, what do you think about Jeremy's idea to make this warning more > > prominent, e.g. by adding a Gtk label? This way it wouldn't be so easily > > missed. > > I'll review a patch to do it :-) In a new bug, please.
Attachment 355092 [details] pushed as 82546fa - mouse: Fix synaptics check
The check still remains for at https://gitlab.gnome.org/GNOME/gnome-control-center/blob/master/panels/mouse/cc-mouse-caps-helper.c#L56 Shouldn't that be removed too?