This touchpad has cursor jumps for 2-finger scrolling that also affects the
single-finger emulation. So disable any multitouch bits on this device and
disallow the 2-finger scroll method. This still allows for 2-finger
tapping/clicking.

https://bugs.freedesktop.org/show_bug.cgi?id=91135

Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
---
Changes to v1:
- move the DM4 magic to tp_init_slots and pretend it's a single-touch
  touchpad.

 src/evdev-mt-touchpad.c            | 12 +++++++++++-
 src/evdev.c                        |  1 +
 src/evdev.h                        |  1 +
 udev/90-libinput-model-quirks.hwdb |  4 ++++
 4 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index 0492851..0a261a3 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -1770,8 +1770,12 @@ tp_init_slots(struct tp_dispatch *tp,
         * If three fingers are set down in the same frame, one slot has the
         * coordinates 0/0 and may not get updated for several frames.
         * See https://bugzilla.redhat.com/show_bug.cgi?id=1295073
+        *
+        * The HP Pavilion DM4 touchpad has random jumps in slots, including
+        * for single-finger movement. See fdo bug 91135
         */
-       if (tp->semi_mt) {
+       if (tp->semi_mt ||
+           device->model_flags & EVDEV_MODEL_HP_PAVILION_DM4_TOUCHPAD) {
                tp->num_slots = 1;
                tp->slot = 0;
                tp->has_mt = false;
@@ -1874,6 +1878,12 @@ tp_scroll_get_methods(struct tp_dispatch *tp)
 {
        uint32_t methods = LIBINPUT_CONFIG_SCROLL_EDGE;
 
+       /* Any movement with more than one finger has random cursor
+        * jumps. Don't allow for 2fg scrolling on this device, see
+        * fdo bug 91135 */
+       if (tp->device->model_flags & EVDEV_MODEL_HP_PAVILION_DM4_TOUCHPAD)
+               return LIBINPUT_CONFIG_SCROLL_EDGE;
+
        if (tp->ntouches >= 2)
                methods |= LIBINPUT_CONFIG_SCROLL_2FG;
 
diff --git a/src/evdev.c b/src/evdev.c
index afb5e34..57670e2 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -2186,6 +2186,7 @@ evdev_read_model_flags(struct evdev_device *device)
                MODEL(HP8510_TOUCHPAD),
                MODEL(HP6910_TOUCHPAD),
                MODEL(HP_ZBOOK_STUDIO_G3),
+               MODEL(HP_PAVILION_DM4_TOUCHPAD),
 #undef MODEL
                { "ID_INPUT_TRACKBALL", EVDEV_MODEL_TRACKBALL },
                { NULL, EVDEV_MODEL_DEFAULT },
diff --git a/src/evdev.h b/src/evdev.h
index b5a54a2..071b9ec 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -122,6 +122,7 @@ enum evdev_device_model {
        EVDEV_MODEL_HP8510_TOUCHPAD = (1 << 21),
        EVDEV_MODEL_HP6910_TOUCHPAD = (1 << 22),
        EVDEV_MODEL_HP_ZBOOK_STUDIO_G3 = (1 << 23),
+       EVDEV_MODEL_HP_PAVILION_DM4_TOUCHPAD = (1 << 24),
 };
 
 struct mt_slot {
diff --git a/udev/90-libinput-model-quirks.hwdb 
b/udev/90-libinput-model-quirks.hwdb
index 347a229..eb74f61 100644
--- a/udev/90-libinput-model-quirks.hwdb
+++ b/udev/90-libinput-model-quirks.hwdb
@@ -99,6 +99,10 @@ libinput:name:SynPS/2 Synaptics 
TouchPad:dmi:*svnHewlett-Packard:*pnHPCompaq6910
 libinput:name:SynPS/2 Synaptics 
TouchPad:dmi:*svnHewlett-Packard:*pnHPCompaq8510w*
  LIBINPUT_MODEL_HP8510_TOUCHPAD=1
 
+# HP Pavillion dm4
+libinput:name:SynPS/2 Synaptics 
TouchPad:dmi:*svnHewlett-Packard:*pnHPPaviliondm4NotebookPC*
+ LIBINPUT_MODEL_HP_PAVILION_DM4_TOUCHPAD=1
+
 # HP Stream 11
 libinput:name:SYN1EDE:00 
06CB:7442:dmi:*svnHewlett-Packard:pnHPStreamNotebookPC11*
  LIBINPUT_MODEL_HP_STREAM11_TOUCHPAD=1
-- 
2.9.3

_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to