[xorg-x11-drv-synaptics] Fix 3 finger clicking on clickpads (#1086218)
Hans de Goede
jwrdegoede at fedoraproject.org
Mon Apr 14 13:33:29 UTC 2014
commit 859397fa3d8d920ac35c11aeabf53fc00937ccd7
Author: Hans de Goede <hdegoede at redhat.com>
Date: Mon Apr 14 15:33:15 2014 +0200
Fix 3 finger clicking on clickpads (#1086218)
- Add T431 to 70-touchpad-quirks.rules as touchpad_softbutton_top (#1085582)
- Switch to using relative coordinates for the top softbutton area (#1085697)
...t-tripletap-click-as-3-fingerclick-on-pad.patch | 63 ++++++++++++++++++
50-synaptics.conf | 70 ++++----------------
70-touchpad-quirks.rules | 15 ++--
xorg-x11-drv-synaptics.spec | 19 +++---
4 files changed, 94 insertions(+), 73 deletions(-)
---
diff --git a/0001-Always-count-tripletap-click-as-3-fingerclick-on-pad.patch b/0001-Always-count-tripletap-click-as-3-fingerclick-on-pad.patch
new file mode 100644
index 0000000..f68dc20
--- /dev/null
+++ b/0001-Always-count-tripletap-click-as-3-fingerclick-on-pad.patch
@@ -0,0 +1,63 @@
+From 0791cec5d0e0e6f7dfc18735ad12cbcb10551ce8 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede at redhat.com>
+Date: Fri, 11 Apr 2014 15:15:09 +0200
+Subject: [PATCH xf86-input-synaptics] Always count tripletap + click as 3
+ fingerclick on pads with < 3 touches
+
+When trying to do a 3 fingerclick on a touchpad which only tracks 2 touches,
+this may register as a 3 or 2 fingerclick depending on the order in which
+the touchpad detects the fingers. If the 2 outer fingers of the 3 get seen
+first, then the 2 touches will be too far apart for the heuristic to see
+them as being close together, and the click gets counted as a 2 finger click.
+
+A user will likely never do a 2 finger click with a 3th finger resting
+somewhere else on the pad, where-as the above misdetection of the clicks is
+a real issue, so simply always count a click with trippletap set as a
+3 finger click on pads which track less then 3 touches.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1086218
+
+Signed-off-by: Hans de Goede <hdegoede at redhat.com>
+---
+ src/synaptics.c | 25 +++++--------------------
+ 1 file changed, 5 insertions(+), 20 deletions(-)
+
+diff --git a/src/synaptics.c b/src/synaptics.c
+index f4c1d4a..118d1c6 100644
+--- a/src/synaptics.c
++++ b/src/synaptics.c
+@@ -2673,26 +2673,11 @@ clickpad_guess_clickfingers(SynapticsPrivate * priv,
+ }
+
+ /* Some trackpads touchpad only track two touchpoints but announce
+- BTN_TOOL_TRIPLETAP (which sets hw->numFingers to 3).
+- This can affect clickfingers, in the following ways:
+- * one finger down: normal click
+- * two fingers down, close together: 2 finger click
+- * two fingers down, apart: normal click
+- * three fingers down, close together: 3 finger click
+- * three fingers down, with two grouped next to each other: should be
+- * 2-finger click but we can't detect this.
+- * so: if two detected fingers are close together and HW says three
+- * fingers, make it three fingers.
+- * if two detected fingers are apart and HW says three fingers, make
+- * it a two-finger click, guessing that the third finger is somewhere
+- * close to another finger.
+- */
+- if (hw->numFingers >= 3 && nfingers < hw->numFingers) {
+- if (!nfingers) /* touchpoints too far apart */
+- nfingers = 2;
+- else
+- nfingers++;
+- }
++ * BTN_TOOL_TRIPLETAP (which sets hw->numFingers to 3), when this happens
++ * the user likely intents to do a 3 finger click, so handle it as such.
++ */
++ if (hw->numFingers >= 3 && hw->num_mt_mask < 3)
++ nfingers = 3;
+
+ return nfingers;
+ }
+--
+1.9.0
+
diff --git a/50-synaptics.conf b/50-synaptics.conf
index 520246d..b784593 100644
--- a/50-synaptics.conf
+++ b/50-synaptics.conf
@@ -39,6 +39,10 @@ EndSection
# get flaky button behaviour.
# https://bugs.freedesktop.org/show_bug.cgi?id=70819
# https://bugs.freedesktop.org/show_bug.cgi?id=76341
+#
+# This really is a kernel issue, as the kernel should simply not report these
+# as clickpads. This has been fixed in 3.13.9 and later, this section
+# should be removed in the future
Section "InputClass"
Identifier "Disable clickpad for CyPS/2 Cypress Trackpad"
MatchProduct "CyPS/2 Cypress Trackpad"
@@ -59,63 +63,15 @@ Section "InputClass"
Option "AreaBottomEdge" "4000"
EndSection
-# FIXME: This config below requires a kernel fix to expose the device's PnPID
-# correctly https://lkml.org/lkml/2014/2/23/63, and an Xserver fix to
-# actually find that PNPID. So for now, manually configure them with udev
-# rule hacks.
-#
-# WARNING: these devices are affected by a firmware bug that
-# provides us with wrong min/max ranges. So we can't use percentages
-# here and instead hardcode some range that seems sensible for now.
-# Do not copy this into your custom file, wait for the kernel to be
-# fixed and use percentages
+# Some devices have the buttons on the top of the touchpad. For those, set
+# the secondary button area to exactly that.
+# Affected: Lenovo T440, T540, X240, Helix, Yoga
#
-# FTR: this is how it should look like:
-#Section "InputClass"
-# Identifier "Lenovo TrackPoint top software buttons"
-# MatchDriver "synaptics"
-# MatchPnPID "LEN0033*|LEN0034*|LEN0035*|LEN0036*|LEN0042*"
-# Option "SecondarySoftButtonAreas" "58% 0 0 8% 42% 58% 0 8%"
-#EndSection
-
-Section "InputClass"
- Identifier "Lenovo Helix trackstick software button buttons"
- MatchTag "Helix"
- Option "SecondarySoftButtonAreas" "3360 0 0 2464 2716 3359 0 2464"
-EndSection
-
-Section "InputClass"
- Identifier "Lenovo T540 trackstick software button buttons"
- MatchTag "T540"
- Option "SecondarySoftButtonAreas" "3363 0 0 2280 2717 3362 0 2280"
-EndSection
-
-Section "InputClass"
- Identifier "Lenovo X240 trackstick software button buttons"
- MatchTag "X240"
- Option "SecondarySoftButtonAreas" "3835 0 0 1439 3116 3834 0 1439"
-EndSection
-
-Section "InputClass"
- Identifier "Lenovo T440 trackstick software button buttons"
- MatchTag "T440"
- Option "SecondarySoftButtonAreas" "3395 0 0 2248 2741 3394 0 2248"
-EndSection
-
+# Note the touchpad_softbutton_top tag is a temporary solution, we're working
+# on a more permanent solution upstream (likely adding INPUT_PROP_TOPBUTTONPAD)
Section "InputClass"
- Identifier "Lenovo Yoga trackstick software button buttons"
- MatchTag "Yoga"
- Option "SecondarySoftButtonAreas" "3835 0 0 1439 3116 3834 0 1439"
-EndSection
-
-Section "InputClass"
- Identifier "Lenovo L440 trackstick software button buttons"
- MatchTag "L440"
- Option "SecondarySoftButtonAreas" "3835 0 0 1439 3116 3834 0 1439"
-EndSection
-
-Section "InputClass"
- Identifier "Lenovo X1 Carbon trackstick software button buttons"
- MatchTag "X1C"
- Option "SecondarySoftButtonAreas" "3363 0 0 2280 2717 3362 0 2280"
+ Identifier "Lenovo TrackPoint top software buttons"
+ MatchDriver "synaptics"
+ MatchTag "touchpad_softbutton_top"
+ Option "SecondarySoftButtonAreas" "58% 0 0 8% 42% 58% 0 8%"
EndSection
diff --git a/70-touchpad-quirks.rules b/70-touchpad-quirks.rules
index 3da28f9..b5cbfd3 100644
--- a/70-touchpad-quirks.rules
+++ b/70-touchpad-quirks.rules
@@ -12,12 +12,13 @@ ENV{ID_INPUT_TOUCHPAD}!="1", GOTO="touchpad_quirks_end"
ATTR{[dmi/id]product_name}=="Inspiron 1011|Inspiron 1012", \
ENV{ID_INPUT.tags}="touchpad_button_overlap"
-ATTR{[dmi/id]product_version}=="*T440*", ENV{ID_INPUT.tags}="T440"
-ATTR{[dmi/id]product_version}=="*L440*", ENV{ID_INPUT.tags}="L440"
-ATTR{[dmi/id]product_version}=="*T540*", ENV{ID_INPUT.tags}="T540"
-ATTR{[dmi/id]product_version}=="*X240*", ENV{ID_INPUT.tags}="X240"
-ATTR{[dmi/id]product_version}=="*Helix*" ENV{ID_INPUT.tags}="X240"
-ATTR{[dmi/id]product_version}=="*Yoga*", ENV{ID_INPUT.tags}="Yoga"
-ATTR{[dmi/id]product_version}=="*X1 Carbon 2nd*", ENV{ID_INPUT.tags}="X1C"
+ATTR{[dmi/id]product_version}=="ThinkPad X240*", ENV{ID_INPUT.tags}="touchpad_softbutton_top"
+ATTR{[dmi/id]product_version}=="ThinkPad T431*", ENV{ID_INPUT.tags}="touchpad_softbutton_top"
+ATTR{[dmi/id]product_version}=="ThinkPad T440*", ENV{ID_INPUT.tags}="touchpad_softbutton_top"
+ATTR{[dmi/id]product_version}=="ThinkPad L440*", ENV{ID_INPUT.tags}="touchpad_softbutton_top"
+ATTR{[dmi/id]product_version}=="ThinkPad T540*", ENV{ID_INPUT.tags}="touchpad_softbutton_top"
+ATTR{[dmi/id]product_version}=="ThinkPad Helix*" ENV{ID_INPUT.tags}="touchpad_softbutton_top"
+ATTR{[dmi/id]product_version}=="ThinkPad S1 Yoga", ENV{ID_INPUT.tags}="touchpad_softbutton_top"
+ATTR{[dmi/id]product_version}=="ThinkPad X1 Carbon 2nd*", ENV{ID_INPUT.tags}="touchpad_softbutton_top"
LABEL="touchpad_quirks_end"
diff --git a/xorg-x11-drv-synaptics.spec b/xorg-x11-drv-synaptics.spec
index e80cadd..58adfb7 100644
--- a/xorg-x11-drv-synaptics.spec
+++ b/xorg-x11-drv-synaptics.spec
@@ -8,7 +8,7 @@
Name: xorg-x11-drv-synaptics
Summary: Xorg X11 Synaptics touchpad input driver
Version: 1.7.99.1
-Release: 4%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist}
+Release: 5%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist}
URL: http://www.x.org
License: MIT
Group: User Interface/X Hardware Support
@@ -23,6 +23,8 @@ Source0: ftp://ftp.x.org/pub/individual/driver/%{tarball}-%{version}.tar.
Source3: 50-synaptics.conf
Source4: 70-touchpad-quirks.rules
+Patch1: 0001-Always-count-tripletap-click-as-3-fingerclick-on-pad.patch
+
ExcludeArch: s390 s390x
BuildRequires: autoconf automake libtool pkgconfig
@@ -80,6 +82,7 @@ Features:
%prep
%setup -q -n %{tarball}-%{?gitdate:%{gitdate}}%{!?gitdate:%{version}}
+%patch1 -p1
%build
autoreconf -v --install --force || exit 1
@@ -87,9 +90,7 @@ autoreconf -v --install --force || exit 1
make %{?_smp_mflags}
%install
-rm -rf $RPM_BUILD_ROOT
-
-make install DESTDIR=$RPM_BUILD_ROOT
+%make_install
# FIXME: Remove all libtool archives (*.la) from modules directory. This
# should be fixed in upstream Makefile.am or whatever.
@@ -102,11 +103,7 @@ install -d $RPM_BUILD_ROOT%{_prefix}/lib/udev/rules.d/
install -m 0644 %{SOURCE4} $RPM_BUILD_ROOT%{_prefix}/lib/udev/rules.d/70-touchpad-quirks.rules
-%clean
-rm -rf $RPM_BUILD_ROOT
-
%files
-%defattr(-,root,root,-)
%doc COPYING
%{_datadir}/X11/xorg.conf.d/50-synaptics.conf
%{driverdir}/synaptics_drv.so
@@ -127,7 +124,6 @@ Requires: pkgconfig
Development files for the Synaptics TouchPad for X.Org.
%files devel
-%defattr(-,root,root,-)
%doc COPYING
%{_libdir}/pkgconfig/xorg-synaptics.pc
%dir %{_includedir}/xorg
@@ -135,6 +131,11 @@ Development files for the Synaptics TouchPad for X.Org.
%changelog
+* Mon Apr 14 2014 Hans de Goede <hdegoede at redhat.com> 1.7.99.1-5.20140318gitfd7099004
+- Fix 3 finger clicking on clickpads (#1086218)
+- Add T431 to 70-touchpad-quirks.rules as touchpad_softbutton_top (#1085582)
+- Switch to using relative coordinates for the top softbutton area (#1085697)
+
* Wed Apr 09 2014 Peter Hutterer <peter.hutterer at redhat.com> 1.7.99.1-4.20140318gitfd7099004
- Add L440 and X1 Carbon tags/config
More information about the scm-commits
mailing list