libinput 0.21.0

- fix 3fg touch detection on Synaptics semi-mt touchpads
This commit is contained in:
Peter Hutterer 2015-08-04 11:52:44 +10:00
parent 5d1af9d382
commit 6af3f5842b
15 changed files with 70 additions and 910 deletions

1
.gitignore vendored
View File

@ -19,3 +19,4 @@
/libinput-0.18.0.tar.xz
/libinput-0.19.0.tar.xz
/libinput-0.20.0.tar.xz
/libinput-0.21.0.tar.xz

View File

@ -1,26 +0,0 @@
From a899d62c05d322581bd86e2d16be588e4655e1b6 Mon Sep 17 00:00:00 2001
From: Fedora X Ninjas <x@fedoraproject.org>
Date: Fri, 24 Jul 2015 08:35:08 +1000
Subject: [PATCH] Disable thumb detection, it's too aggressive (#1246093)
---
src/evdev-mt-touchpad.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index cbe8bed..360f930 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -1507,6 +1507,9 @@ tp_init_thumb(struct tp_dispatch *tp)
struct evdev_device *device = tp->device;
const struct input_absinfo *abs;
+ /* FEDORA: disable thumb detection, too aggressive */
+ return 0;
+
abs = libevdev_get_abs_info(device->evdev, ABS_MT_PRESSURE);
if (!abs)
return 0;
--
2.4.3

View File

@ -1,58 +0,0 @@
From c096bedd8b21864b5ce27403a628c519ad00e148 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue, 21 Jul 2015 09:33:47 +1000
Subject: [PATCH libinput] evdev: restore pointing stick const accel property
parsing
Regression introduced in 8302860.
Reading the DPI before evdev_configure_device makes it lose on the trackpoint
flag, causing libinput to ignore the POINTINGSTICK_CONST_ACCEL property.
8302860 moved it up so we can init accel based on the DPI, this patch simply
moves istart t before the acceleration is initialized.
https://bugs.freedesktop.org/show_bug.cgi?id=91369
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
---
src/evdev.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/evdev.c b/src/evdev.c
index 05d9b17..07934de 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1958,6 +1958,10 @@ evdev_configure_device(struct evdev_device *device)
if (udev_tags & EVDEV_UDEV_TAG_MOUSE ||
udev_tags & EVDEV_UDEV_TAG_POINTINGSTICK) {
+ evdev_tag_external_mouse(device, device->udev_device);
+ evdev_tag_trackpoint(device, device->udev_device);
+ device->dpi = evdev_read_dpi_prop(device);
+
if (libevdev_has_event_code(evdev, EV_REL, REL_X) &&
libevdev_has_event_code(evdev, EV_REL, REL_Y) &&
evdev_init_accel(device) == -1)
@@ -1975,9 +1979,6 @@ evdev_configure_device(struct evdev_device *device)
device->scroll.natural_scrolling_enabled = true;
/* want button scrolling config option */
device->scroll.want_button = 1;
-
- evdev_tag_external_mouse(device, device->udev_device);
- evdev_tag_trackpoint(device, device->udev_device);
}
if (udev_tags & EVDEV_UDEV_TAG_KEYBOARD) {
@@ -2146,7 +2147,7 @@ evdev_device_create(struct libinput_seat *seat,
device->scroll.wheel_click_angle =
evdev_read_wheel_click_prop(device);
device->model = evdev_read_model(device);
- device->dpi = evdev_read_dpi_prop(device);
+ device->dpi = DEFAULT_MOUSE_DPI;
/* at most 5 SYN_DROPPED log-messages per 30s */
ratelimit_init(&device->syn_drop_limit, 30ULL * 1000, 5);
--
2.4.3

View File

@ -1,59 +0,0 @@
From 6b59b4273c38570258519d16357dd0953b650bc8 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue, 28 Jul 2015 12:54:16 +1000
Subject: [PATCH libinput] touchpad: drop distance threshold to detect pinches
This gives us too many false positives of 2fg scroll being detected as pinch
gesture. Reporter in [1] uses index+ring finger and thus exceeds the distance
easily (that's admittedly a special case).
This is worsed by the lack of a client stack that handles the gestures. User's
don't see that they're inadvertently performing a gesture, they just see 2fg
scroll not working.
Drop the distance for now, once we have a ubiquitous client stack we can
revisit and bring it back.
[1] https://bugzilla.redhat.com/show_bug.cgi?id=1246868
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
src/evdev-mt-touchpad-gestures.c | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)
diff --git a/src/evdev-mt-touchpad-gestures.c b/src/evdev-mt-touchpad-gestures.c
index 6b1a273..3b1839e 100644
--- a/src/evdev-mt-touchpad-gestures.c
+++ b/src/evdev-mt-touchpad-gestures.c
@@ -264,26 +264,11 @@ tp_gesture_twofinger_handle_state_none(struct tp_dispatch *tp, uint64_t time)
static enum tp_gesture_2fg_state
tp_gesture_twofinger_handle_state_unknown(struct tp_dispatch *tp, uint64_t time)
{
- struct normalized_coords normalized;
- struct device_float_coords delta;
struct tp_touch *first = tp->gesture.touches[0],
*second = tp->gesture.touches[1];
int dir1, dir2;
- delta = device_delta(first->point, second->point);
- normalized = tp_normalize_delta(tp, delta);
-
- /* If fingers are further than 3 cm apart assume pinch */
- if (normalized_length(normalized) > TP_MM_TO_DPI_NORMALIZED(30)) {
- tp_gesture_get_pinch_info(tp,
- &tp->gesture.initial_distance,
- &tp->gesture.angle,
- &tp->gesture.center);
- tp->gesture.prev_scale = 1.0;
- return GESTURE_2FG_STATE_PINCH;
- }
-
- /* Elif fingers have been close together for a while, scroll */
+ /* if fingers stay unmoving for a while, assume (slow) scroll */
if (time > (tp->gesture.initial_time + DEFAULT_GESTURE_2FG_SCROLL_TIMEOUT)) {
tp_gesture_set_scroll_buildup(tp);
return GESTURE_2FG_STATE_SCROLL;
--
2.4.3

View File

@ -1,35 +0,0 @@
From 0d320c87c99e93b2feb1703f5bfd5d4fcc0a2857 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Mon, 13 Jul 2015 14:14:42 +1000
Subject: [PATCH libinput] touchpad: only edge-scroll while the finger is in
the edge area
When the touch leaves the area for edge scrolling after starting to scroll,
discard any movement. This signals to the user that they've left the area and
forces them to lift the finger to switch back to motion. If the finger moves
back into the area, scrolling continues.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
---
src/evdev-mt-touchpad-edge-scroll.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/evdev-mt-touchpad-edge-scroll.c b/src/evdev-mt-touchpad-edge-scroll.c
index ca9ef4a..4f8362c 100644
--- a/src/evdev-mt-touchpad-edge-scroll.c
+++ b/src/evdev-mt-touchpad-edge-scroll.c
@@ -384,6 +384,11 @@ tp_edge_scroll_post_events(struct tp_dispatch *tp, uint64_t time)
if (t->palm.state != PALM_NONE)
continue;
+ /* only scroll with the finger in the previous edge */
+ if (t->scroll.edge &&
+ (tp_touch_get_edge(tp, t) & t->scroll.edge) == 0)
+ continue;
+
switch (t->scroll.edge) {
case EDGE_NONE:
if (t->scroll.direction != -1) {
--
2.4.3

View File

@ -1,47 +0,0 @@
From 7ac32de18ca54a3a7d0b8147facc0ba7ebb9dbd4 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Thu, 16 Jul 2015 15:54:47 +1000
Subject: [PATCH libinput 1/4] touchpad: remove a leftover check for fake
resolution
obsolete since 8658ff159d416b6a567acb2aaf72b27887ad8576. And once we remove
that all we checkf or is Apple models which we set a resolution for in
systemd. So that check is obsolete now too.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 4ca70c813f750721592d1a68aced385560705256)
---
src/evdev-mt-touchpad.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index 360f930..80827da 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -1464,18 +1464,13 @@ tp_init_palmdetect(struct tp_dispatch *tp,
/* Wacom doesn't have internal touchpads,
* Apple touchpads are always big enough to warrant palm detection */
- if (device->model == EVDEV_MODEL_WACOM_TOUCHPAD) {
+ if (device->model == EVDEV_MODEL_WACOM_TOUCHPAD)
return 0;
- } else if (device->model != EVDEV_MODEL_APPLE_TOUCHPAD) {
- /* We don't know how big the touchpad is */
- if (device->abs.absinfo_x->resolution == 1)
- return 0;
- /* Enable palm detection on touchpads >= 70 mm. Anything smaller
- probably won't need it, until we find out it does */
- if (width/device->abs.absinfo_x->resolution < 70)
- return 0;
- }
+ /* Enable palm detection on touchpads >= 70 mm. Anything smaller
+ probably won't need it, until we find out it does */
+ if (width/device->abs.absinfo_x->resolution < 70)
+ return 0;
/* palm edges are 5% of the width on each side */
tp->palm.right_edge = device->abs.absinfo_x->maximum - width * 0.05;
--
2.4.3

View File

@ -0,0 +1,60 @@
From 253f8e4152b6c36b87756bb23b16512c3abf7cb8 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Fri, 24 Jul 2015 11:13:41 +1000
Subject: [PATCH libinput] touchpad: serial synaptics need to fake new touches
on TRIPLETAP
On the 4.1 kernels synaptics pretends to have 3 slots (the serial fw only does
2). This was added to avoid cursor jumps but has since been reverted for 4.2
(kernel commit dbf3c37086, 4.1.3 is still buggy). In some cases a TRIPLETAP
may be triggered without slot 2 ever activating.
While there are still those kernels out there, work around this bug by opening
a new touch point where none exists if the fake finger count exceeds the slot
count.
Reported-by: Jan Alexander Steffens <jan.steffens@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Jan Alexander Steffens <jan.steffens@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
src/evdev-mt-touchpad.c | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index a683d9a..5ef03d5 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -369,13 +369,23 @@ tp_restore_synaptics_touches(struct tp_dispatch *tp,
for (i = 0; i < tp->num_slots; i++) {
struct tp_touch *t = tp_get_touch(tp, i);
- if (t->state != TOUCH_END)
+ switch(t->state) {
+ case TOUCH_HOVERING:
+ case TOUCH_BEGIN:
+ case TOUCH_UPDATE:
continue;
-
- /* new touch, move it through begin to update immediately */
- tp_new_touch(tp, t, time);
- tp_begin_touch(tp, t, time);
- t->state = TOUCH_UPDATE;
+ case TOUCH_NONE:
+ /* new touch, move it through to begin immediately */
+ tp_new_touch(tp, t, time);
+ tp_begin_touch(tp, t, time);
+ break;
+ case TOUCH_END:
+ /* touch just ended ,we need need to restore it to update */
+ tp_new_touch(tp, t, time);
+ tp_begin_touch(tp, t, time);
+ t->state = TOUCH_UPDATE;
+ break;
+ }
}
}
--
2.4.3

View File

@ -1,27 +0,0 @@
From b849aaf4d3441f3d007889a06ff105e49d197be8 Mon Sep 17 00:00:00 2001
From: Fedora X Ninjas <x@fedoraproject.org>
Date: Tue, 28 Jul 2015 08:23:29 +1000
Subject: [PATCH] udev: add size hint for appletouch one-button touchpad
---
udev/90-libinput-model-quirks.hwdb | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb
index eec00b6..2d2a449 100644
--- a/udev/90-libinput-model-quirks.hwdb
+++ b/udev/90-libinput-model-quirks.hwdb
@@ -34,6 +34,10 @@ libinput:touchpad:input:b0005v05ACp*
LIBINPUT_MODEL_APPLE_TOUCHPAD=1
LIBINPUT_ATTR_SIZE_HINT=104x75
+# appletouch one-button touchpad (rhbz#1246651)
+libinput:touchpad:input:b0003v05ACp021B*
+ LIBINPUT_ATTR_SIZE_HINT=100x48
+
##########################################
# Elantech
##########################################
--
2.4.3

View File

@ -1,28 +0,0 @@
From 32f298c12700d874c265c2486ae10728bea691a0 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Thu, 16 Jul 2015 15:15:20 +1000
Subject: [PATCH libinput] udev: don't install the litest udev rules
They are installed by the test.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
---
udev/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/udev/Makefile.am b/udev/Makefile.am
index e850e09..975f537 100644
--- a/udev/Makefile.am
+++ b/udev/Makefile.am
@@ -4,7 +4,7 @@ udev_PROGRAMS = libinput-device-group \
litest_rules = 80-libinput-device-groups-litest.rules \
90-libinput-model-quirks-litest.rules
-udev_SCRIPTS = $(litest_rules)
+noinst_SCRIPTS = $(litest_rules)
libinput_device_group_SOURCES = libinput-device-group.c
libinput_device_group_CFLAGS = $(LIBUDEV_CFLAGS) $(GCC_CFLAGS)
--
2.4.3

View File

@ -1,213 +0,0 @@
From da530d630f78bc208a35fd1a6912397253f8db87 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Thu, 16 Jul 2015 15:59:01 +1000
Subject: [PATCH libinput 2/4] evdev: allow for multiple LIBINPUT_MODEL_* flags
per device
On some devices we need to set more than one flag, i.e. make it into actual
flags.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Hallelujah-expressed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit aacf40341dc13761d564ecf910dc833073ae39ae)
---
src/evdev-mt-touchpad-buttons.c | 17 +++++++----------
src/evdev-mt-touchpad.c | 12 ++++--------
src/evdev.c | 11 ++++++-----
src/evdev.h | 22 +++++++++++-----------
udev/90-libinput-model-quirks.rules.in | 10 ++--------
5 files changed, 30 insertions(+), 42 deletions(-)
diff --git a/src/evdev-mt-touchpad-buttons.c b/src/evdev-mt-touchpad-buttons.c
index 5ecdccd..6852758 100644
--- a/src/evdev-mt-touchpad-buttons.c
+++ b/src/evdev-mt-touchpad-buttons.c
@@ -641,22 +641,19 @@ static enum libinput_config_click_method
tp_click_get_default_method(struct tp_dispatch *tp)
{
struct evdev_device *device = tp->device;
+ uint32_t clickfinger_models = EVDEV_MODEL_CHROMEBOOK |
+ EVDEV_MODEL_SYSTEM76_BONOBO |
+ EVDEV_MODEL_SYSTEM76_GALAGO |
+ EVDEV_MODEL_SYSTEM76_KUDU |
+ EVDEV_MODEL_CLEVO_W740SU;
if (!tp->buttons.is_clickpad)
return LIBINPUT_CONFIG_CLICK_METHOD_NONE;
else if (libevdev_get_id_vendor(tp->device->evdev) == VENDOR_ID_APPLE)
return LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER;
- switch (device->model) {
- case EVDEV_MODEL_CHROMEBOOK:
- case EVDEV_MODEL_SYSTEM76_BONOBO:
- case EVDEV_MODEL_SYSTEM76_GALAGO:
- case EVDEV_MODEL_SYSTEM76_KUDU:
- case EVDEV_MODEL_CLEVO_W740SU:
+ if (device->model_flags & clickfinger_models)
return LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER;
- default:
- break;
- }
return LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS;
}
@@ -688,7 +685,7 @@ tp_init_middlebutton_emulation(struct tp_dispatch *tp,
if (!libevdev_has_event_code(device->evdev, EV_KEY, BTN_MIDDLE)) {
enable_by_default = true;
want_config_option = false;
- } else if (device->model == EVDEV_MODEL_ALPS_TOUCHPAD) {
+ } else if (device->model_flags & EVDEV_MODEL_ALPS_TOUCHPAD) {
enable_by_default = true;
want_config_option = true;
} else
diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index 80827da..c5c54bb 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -1228,7 +1228,7 @@ evdev_tag_touchpad(struct evdev_device *device,
*/
bustype = libevdev_get_id_bustype(device->evdev);
if (bustype == BUS_USB) {
- if (device->model == EVDEV_MODEL_APPLE_TOUCHPAD)
+ if (device->model_flags & EVDEV_MODEL_APPLE_TOUCHPAD)
device->tags |= EVDEV_TAG_INTERNAL_TOUCHPAD;
} else if (bustype != BUS_BLUETOOTH)
device->tags |= EVDEV_TAG_INTERNAL_TOUCHPAD;
@@ -1354,14 +1354,10 @@ tp_init_accel(struct tp_dispatch *tp, double diagonal)
tp->accel.x_scale_coeff = (DEFAULT_MOUSE_DPI/25.4) / res_x;
tp->accel.y_scale_coeff = (DEFAULT_MOUSE_DPI/25.4) / res_y;
- switch (tp->device->model) {
- case EVDEV_MODEL_LENOVO_X230:
+ if (tp->device->model_flags & EVDEV_MODEL_LENOVO_X230)
profile = touchpad_lenovo_x230_accel_profile;
- break;
- default:
+ else
profile = touchpad_accel_profile_linear;
- break;
- }
if (evdev_device_init_pointer_acceleration(tp->device, profile) == -1)
return -1;
@@ -1464,7 +1460,7 @@ tp_init_palmdetect(struct tp_dispatch *tp,
/* Wacom doesn't have internal touchpads,
* Apple touchpads are always big enough to warrant palm detection */
- if (device->model == EVDEV_MODEL_WACOM_TOUCHPAD)
+ if (device->model_flags & EVDEV_MODEL_WACOM_TOUCHPAD)
return 0;
/* Enable palm detection on touchpads >= 70 mm. Anything smaller
diff --git a/src/evdev.c b/src/evdev.c
index 950b334..2e757d8 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1521,8 +1521,8 @@ evdev_read_dpi_prop(struct evdev_device *device)
return dpi;
}
-static inline enum evdev_device_model
-evdev_read_model(struct evdev_device *device)
+static inline uint32_t
+evdev_read_model_flags(struct evdev_device *device)
{
const struct model_map {
const char *property;
@@ -1540,15 +1540,16 @@ evdev_read_model(struct evdev_device *device)
{ NULL, EVDEV_MODEL_DEFAULT },
};
const struct model_map *m = model_map;
+ uint32_t model_flags = 0;
while (m->property) {
if (!!udev_device_get_property_value(device->udev_device,
m->property))
- break;
+ model_flags |= m->model;
m++;
}
- return m->model;
+ return model_flags;
}
static inline int
@@ -2142,7 +2143,7 @@ evdev_device_create(struct libinput_seat *seat,
device->scroll.direction = 0;
device->scroll.wheel_click_angle =
evdev_read_wheel_click_prop(device);
- device->model = evdev_read_model(device);
+ device->model_flags = evdev_read_model_flags(device);
device->dpi = DEFAULT_MOUSE_DPI;
/* at most 5 SYN_DROPPED log-messages per 30s */
diff --git a/src/evdev.h b/src/evdev.h
index 77db1b4..363f93b 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -95,16 +95,16 @@ enum evdev_middlebutton_event {
};
enum evdev_device_model {
- EVDEV_MODEL_DEFAULT,
- EVDEV_MODEL_LENOVO_X230,
- EVDEV_MODEL_CHROMEBOOK,
- EVDEV_MODEL_SYSTEM76_BONOBO,
- EVDEV_MODEL_SYSTEM76_GALAGO,
- EVDEV_MODEL_SYSTEM76_KUDU,
- EVDEV_MODEL_CLEVO_W740SU,
- EVDEV_MODEL_APPLE_TOUCHPAD,
- EVDEV_MODEL_WACOM_TOUCHPAD,
- EVDEV_MODEL_ALPS_TOUCHPAD,
+ EVDEV_MODEL_DEFAULT = 0,
+ EVDEV_MODEL_LENOVO_X230 = (1 << 0),
+ EVDEV_MODEL_CHROMEBOOK = (1 << 1),
+ EVDEV_MODEL_SYSTEM76_BONOBO = (1 << 2),
+ EVDEV_MODEL_SYSTEM76_GALAGO = (1 << 3),
+ EVDEV_MODEL_SYSTEM76_KUDU = (1 << 4),
+ EVDEV_MODEL_CLEVO_W740SU = (1 << 5),
+ EVDEV_MODEL_APPLE_TOUCHPAD = (1 << 6),
+ EVDEV_MODEL_WACOM_TOUCHPAD = (1 << 7),
+ EVDEV_MODEL_ALPS_TOUCHPAD = (1 << 8),
};
struct mt_slot {
@@ -221,7 +221,7 @@ struct evdev_device {
int dpi; /* HW resolution */
struct ratelimit syn_drop_limit; /* ratelimit for SYN_DROPPED logging */
- enum evdev_device_model model;
+ uint32_t model_flags;
};
#define EVDEV_UNHANDLED_DEVICE ((struct evdev_device *) 1)
diff --git a/udev/90-libinput-model-quirks.rules.in b/udev/90-libinput-model-quirks.rules.in
index d834155..5b07726 100644
--- a/udev/90-libinput-model-quirks.rules.in
+++ b/udev/90-libinput-model-quirks.rules.in
@@ -25,18 +25,12 @@ KERNELS=="*input*", \
IMPORT{builtin}="hwdb 'libinput:name:$attr{name}:fwversion:$env{LIBINPUT_MODEL_FIRMWARE_VERSION}'"
# End of touchpad firmware detection
-# Matches below are exclusive, if one matches we skip the rest
-# hwdb matches:
-#
# libinput:touchpad:<modalias>
ENV{ID_INPUT_TOUCHPAD}=="1", \
- IMPORT{builtin}="hwdb --subsystem=input --lookup-prefix=libinput:touchpad:", \
- GOTO="libinput_model_quirks_end"
+ IMPORT{builtin}="hwdb --subsystem=input --lookup-prefix=libinput:touchpad:"
# libinput:name:<name>:dmi:<dmi string>
KERNELS=="input*", \
- IMPORT{builtin}="hwdb 'libinput:name:$attr{name}:$attr{[dmi/id]modalias}'", \
- GOTO="libinput_model_quirks_end"
-
+ IMPORT{builtin}="hwdb 'libinput:name:$attr{name}:$attr{[dmi/id]modalias}'"
LABEL="libinput_model_quirks_end"
--
2.4.3

View File

@ -1,32 +0,0 @@
From c24a69a0db8cc18e580cc813b91fae6aff9bb74a Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Wed, 29 Jul 2015 17:12:53 +1000
Subject: [PATCH libinput] gestures: check ntouches, not just num_slots for the
number of fingers
We need to check fake fingers as well as real fingers, especially for
two-finger scrolling on single-touch touchpads with BTN_TOOL_DOUBLETAP.
https://bugzilla.redhat.com/show_bug.cgi?id=1246651
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
---
src/evdev-mt-touchpad-gestures.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/evdev-mt-touchpad-gestures.c b/src/evdev-mt-touchpad-gestures.c
index 8bcdeb4..6b1a273 100644
--- a/src/evdev-mt-touchpad-gestures.c
+++ b/src/evdev-mt-touchpad-gestures.c
@@ -157,7 +157,7 @@ tp_gesture_get_active_touches(struct tp_dispatch *tp,
memset(touches, 0, count * sizeof(struct tp_touch *));
- for (i = 0; i < tp->num_slots; i++) {
+ for (i = 0; i < tp->ntouches; i++) {
t = &tp->touches[i];
if (tp_touch_active(tp, t)) {
touches[n++] = t;
--
2.4.3

View File

@ -1,114 +0,0 @@
From 7c249ed9722f411e0acdd12e14dc81c617309974 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Thu, 16 Jul 2015 16:05:48 +1000
Subject: [PATCH libinput 3/4] Tag synaptics serial touchpads with a
LIBINPUT_MODEL tag
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Hallelujah-expressed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit ab016fd8ed84b58a8f9cabc958cd91ebb4110e57)
---
src/evdev.c | 1 +
src/evdev.h | 1 +
src/libinput-util.h | 2 ++
test/device.c | 23 +++++++++++++++++++++++
udev/90-libinput-model-quirks.hwdb | 6 ++++++
5 files changed, 33 insertions(+)
diff --git a/src/evdev.c b/src/evdev.c
index 2e757d8..96ad2a7 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1537,6 +1537,7 @@ evdev_read_model_flags(struct evdev_device *device)
{ "LIBINPUT_MODEL_APPLE_TOUCHPAD", EVDEV_MODEL_APPLE_TOUCHPAD },
{ "LIBINPUT_MODEL_WACOM_TOUCHPAD", EVDEV_MODEL_WACOM_TOUCHPAD },
{ "LIBINPUT_MODEL_ALPS_TOUCHPAD", EVDEV_MODEL_ALPS_TOUCHPAD },
+ { "LIBINPUT_MODEL_SYNAPTICS_SERIAL_TOUCHPAD", EVDEV_MODEL_SYNAPTICS_SERIAL_TOUCHPAD },
{ NULL, EVDEV_MODEL_DEFAULT },
};
const struct model_map *m = model_map;
diff --git a/src/evdev.h b/src/evdev.h
index 363f93b..6a71232 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -105,6 +105,7 @@ enum evdev_device_model {
EVDEV_MODEL_APPLE_TOUCHPAD = (1 << 6),
EVDEV_MODEL_WACOM_TOUCHPAD = (1 << 7),
EVDEV_MODEL_ALPS_TOUCHPAD = (1 << 8),
+ EVDEV_MODEL_SYNAPTICS_SERIAL_TOUCHPAD = (1 << 9),
};
struct mt_slot {
diff --git a/src/libinput-util.h b/src/libinput-util.h
index f27bcfd..85fc93a 100644
--- a/src/libinput-util.h
+++ b/src/libinput-util.h
@@ -37,6 +37,8 @@
#define VENDOR_ID_APPLE 0x5ac
#define VENDOR_ID_WACOM 0x56a
+#define VENDOR_ID_SYNAPTICS_SERIAL 0x002
+#define PRODUCT_ID_SYNAPTICS_SERIAL 0x007
/* The HW DPI rate we normalize to before calculating pointer acceleration */
#define DEFAULT_MOUSE_DPI 1000
diff --git a/test/device.c b/test/device.c
index f43228c..59939d6 100644
--- a/test/device.c
+++ b/test/device.c
@@ -1008,6 +1008,28 @@ START_TEST(device_udev_tag_apple)
udev_device_unref(d);
}
END_TEST
+
+START_TEST(device_udev_tag_synaptics_serial)
+{
+ struct litest_device *dev = litest_current_device();
+ struct libinput_device *device = dev->libinput_device;
+ struct udev_device *d;
+ const char *prop;
+
+ d = libinput_device_get_udev_device(device);
+ prop = udev_device_get_property_value(d,
+ "LIBINPUT_MODEL_SYNAPTICS_SERIAL_TOUCHPAD");
+
+ if (libevdev_get_id_vendor(dev->evdev) == VENDOR_ID_SYNAPTICS_SERIAL &&
+ libevdev_get_id_product(dev->evdev) == PRODUCT_ID_SYNAPTICS_SERIAL)
+ ck_assert_notnull(prop);
+ else
+ ck_assert(prop == NULL);
+
+ udev_device_unref(d);
+}
+END_TEST
+
void
litest_setup_tests(void)
{
@@ -1054,4 +1076,5 @@ litest_setup_tests(void)
litest_add("device:udev tags", device_udev_tag_alps, LITEST_TOUCHPAD, LITEST_ANY);
litest_add("device:udev tags", device_udev_tag_wacom, LITEST_TOUCHPAD, LITEST_ANY);
litest_add("device:udev tags", device_udev_tag_apple, LITEST_TOUCHPAD, LITEST_ANY);
+ litest_add("device:udev tags", device_udev_tag_synaptics_serial, LITEST_TOUCHPAD, LITEST_ANY);
}
diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb
index eec00b6..a34b8f1 100644
--- a/udev/90-libinput-model-quirks.hwdb
+++ b/udev/90-libinput-model-quirks.hwdb
@@ -71,6 +71,12 @@ libinput:name:SynPS/2 Synaptics TouchPad:dmi:*svnLENOVO:*:pvrThinkPadX230*
LIBINPUT_MODEL_LENOVO_X230=1
##########################################
+# Synaptics
+##########################################
+libinput:touchpad:input:b0011v0002p0007*
+ LIBINPUT_MODEL_SYNAPTICS_SERIAL_TOUCHPAD=1
+
+##########################################
# System76
##########################################
--
2.4.3

View File

@ -1,253 +0,0 @@
From a4923241ca5b14e78224b50f9b0056f940e0cb7d Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue, 14 Jul 2015 10:27:46 +1000
Subject: [PATCH libinput 4/4] touchpad: disable 2fg scrolling on Synaptics
semi-mt touchpads
These touchpads have a terrible resolution when two fingers are down, causing
scrolling to jump around a lot. That then turns into bug reports that we can't
do much about, the data is simply garbage.
https://bugs.freedesktop.org/show_bug.cgi?id=91135
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit eb146677eb5abb7951af4ead80874c992915b90d)
---
doc/scrolling.dox | 7 +++++++
src/evdev-mt-touchpad.c | 36 +++++++++++++++++++++++++++++-------
src/evdev.c | 1 +
src/evdev.h | 1 +
test/litest-device-synaptics-hover.c | 10 ++++++++++
test/touchpad.c | 21 ++++++++++++++++++---
udev/libinput-model-quirks.c | 26 ++++++++++++++++++++++++++
7 files changed, 92 insertions(+), 10 deletions(-)
diff --git a/doc/scrolling.dox b/doc/scrolling.dox
index 658fe4b..0c03c98 100644
--- a/doc/scrolling.dox
+++ b/doc/scrolling.dox
@@ -44,6 +44,13 @@ movements will translate into tiny scroll movements.
Scrolling in both directions at once is possible by meeting the required
distance thresholds to enable each direction separately.
+Two-finger scrolling requires the touchpad to track both touch points with
+reasonable precision. Unfortunately, some so-called "semi-mt" touchpads can
+only track the bounding box of the two fingers rather than the actual
+position of each finger. In addition, that bounding box usually suffers from
+a low resolution, causing jumpy movement during two-finger scrolling.
+libinput does not provide two-finger scrolling on those touchpads.
+
@section edge_scrolling Edge scrolling
On some touchpads, edge scrolling is available, triggered by moving a single
diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index c5c54bb..a9f4000 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -1366,18 +1366,29 @@ tp_init_accel(struct tp_dispatch *tp, double diagonal)
}
static uint32_t
-tp_scroll_config_scroll_method_get_methods(struct libinput_device *device)
+tp_scroll_get_methods(struct tp_dispatch *tp)
{
- struct evdev_device *evdev = (struct evdev_device*)device;
- struct tp_dispatch *tp = (struct tp_dispatch*)evdev->dispatch;
uint32_t methods = LIBINPUT_CONFIG_SCROLL_EDGE;
- if (tp->ntouches >= 2)
+ /* some Synaptics semi-mt touchpads have a terrible 2fg resolution,
+ * causing scroll jumps. For all other 2fg touchpads, we enable 2fg
+ * scrolling */
+ if (tp->ntouches >= 2 &&
+ (tp->device->model_flags & EVDEV_MODEL_JUMPING_SEMI_MT) == 0)
methods |= LIBINPUT_CONFIG_SCROLL_2FG;
return methods;
}
+static uint32_t
+tp_scroll_config_scroll_method_get_methods(struct libinput_device *device)
+{
+ struct evdev_device *evdev = (struct evdev_device*)device;
+ struct tp_dispatch *tp = (struct tp_dispatch*)evdev->dispatch;
+
+ return tp_scroll_get_methods(tp);
+}
+
static enum libinput_config_status
tp_scroll_config_scroll_method_set_method(struct libinput_device *device,
enum libinput_config_scroll_method method)
@@ -1409,10 +1420,21 @@ tp_scroll_config_scroll_method_get_method(struct libinput_device *device)
static enum libinput_config_scroll_method
tp_scroll_get_default_method(struct tp_dispatch *tp)
{
- if (tp->ntouches >= 2)
- return LIBINPUT_CONFIG_SCROLL_2FG;
+ uint32_t methods;
+ enum libinput_config_scroll_method method;
+
+ methods = tp_scroll_get_methods(tp);
+
+ if (methods & LIBINPUT_CONFIG_SCROLL_2FG)
+ method = LIBINPUT_CONFIG_SCROLL_2FG;
else
- return LIBINPUT_CONFIG_SCROLL_EDGE;
+ method = LIBINPUT_CONFIG_SCROLL_EDGE;
+
+ if ((methods & method) == 0)
+ log_bug_libinput(tp_libinput_context(tp),
+ "Invalid default scroll method %d\n",
+ method);
+ return method;
}
static enum libinput_config_scroll_method
diff --git a/src/evdev.c b/src/evdev.c
index 96ad2a7..35fc2a3 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1538,6 +1538,7 @@ evdev_read_model_flags(struct evdev_device *device)
{ "LIBINPUT_MODEL_WACOM_TOUCHPAD", EVDEV_MODEL_WACOM_TOUCHPAD },
{ "LIBINPUT_MODEL_ALPS_TOUCHPAD", EVDEV_MODEL_ALPS_TOUCHPAD },
{ "LIBINPUT_MODEL_SYNAPTICS_SERIAL_TOUCHPAD", EVDEV_MODEL_SYNAPTICS_SERIAL_TOUCHPAD },
+ { "LIBINPUT_MODEL_JUMPING_SEMI_MT", EVDEV_MODEL_JUMPING_SEMI_MT },
{ NULL, EVDEV_MODEL_DEFAULT },
};
const struct model_map *m = model_map;
diff --git a/src/evdev.h b/src/evdev.h
index 6a71232..1c4ebc0 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -106,6 +106,7 @@ enum evdev_device_model {
EVDEV_MODEL_WACOM_TOUCHPAD = (1 << 7),
EVDEV_MODEL_ALPS_TOUCHPAD = (1 << 8),
EVDEV_MODEL_SYNAPTICS_SERIAL_TOUCHPAD = (1 << 9),
+ EVDEV_MODEL_JUMPING_SEMI_MT = (1 << 10),
};
struct mt_slot {
diff --git a/test/litest-device-synaptics-hover.c b/test/litest-device-synaptics-hover.c
index 2cc9b72..3c36aff 100644
--- a/test/litest-device-synaptics-hover.c
+++ b/test/litest-device-synaptics-hover.c
@@ -102,6 +102,15 @@ static struct input_absinfo absinfo[] = {
{ .value = -1 }
};
+static const char udev_rule[] =
+"ACTION==\"remove\", GOTO=\"synaptics_semi_mt_end\"\n"
+"KERNEL!=\"event*\", GOTO=\"synaptics_semi_mt_end\"\n"
+"\n"
+"ATTRS{name}==\"SynPS/2 Synaptics TouchPad\",\n"
+" ENV{LIBINPUT_MODEL_JUMPING_SEMI_MT}=\"1\"\n"
+"\n"
+"LABEL=\"synaptics_semi_mt_end\"";
+
struct litest_test_device litest_synaptics_hover_device = {
.type = LITEST_SYNAPTICS_HOVER_SEMI_MT,
.features = LITEST_TOUCHPAD | LITEST_SEMI_MT | LITEST_BUTTON,
@@ -114,6 +123,7 @@ struct litest_test_device litest_synaptics_hover_device = {
.id = &input_id,
.events = events,
.absinfo = absinfo,
+ .udev_rule = udev_rule,
};
static void
diff --git a/test/touchpad.c b/test/touchpad.c
index 12bceea..759f82a 100644
--- a/test/touchpad.c
+++ b/test/touchpad.c
@@ -69,6 +69,16 @@ enable_buttonareas(struct litest_device *dev)
litest_assert_int_eq(status, expected);
}
+static inline int
+is_synaptics_semi_mt(struct litest_device *dev)
+{
+ struct libevdev *evdev = dev->evdev;
+
+ return libevdev_has_property(evdev, INPUT_PROP_SEMI_MT) &&
+ libevdev_get_id_vendor(evdev) == 0x2 &&
+ libevdev_get_id_product(evdev) == 0x7;
+}
+
START_TEST(touchpad_1fg_motion)
{
struct litest_device *dev = litest_current_device();
@@ -1581,10 +1591,14 @@ START_TEST(touchpad_scroll_defaults)
method = libinput_device_config_scroll_get_methods(device);
ck_assert(method & LIBINPUT_CONFIG_SCROLL_EDGE);
- if (libevdev_get_num_slots(evdev) > 1)
+ if (libevdev_get_num_slots(evdev) > 1 &&
+ !is_synaptics_semi_mt(dev))
ck_assert(method & LIBINPUT_CONFIG_SCROLL_2FG);
+ else
+ ck_assert((method & LIBINPUT_CONFIG_SCROLL_2FG) == 0);
- if (libevdev_get_num_slots(evdev) > 1)
+ if (libevdev_get_num_slots(evdev) > 1 &&
+ !is_synaptics_semi_mt(dev))
expected = LIBINPUT_CONFIG_SCROLL_2FG;
else
expected = LIBINPUT_CONFIG_SCROLL_EDGE;
@@ -1600,7 +1614,8 @@ START_TEST(touchpad_scroll_defaults)
status = libinput_device_config_scroll_set_method(device,
LIBINPUT_CONFIG_SCROLL_2FG);
- if (libevdev_get_num_slots(evdev) > 1)
+ if (libevdev_get_num_slots(evdev) > 1 &&
+ !is_synaptics_semi_mt(dev))
ck_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS);
else
ck_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED);
diff --git a/udev/libinput-model-quirks.c b/udev/libinput-model-quirks.c
index fc3dbe8..0e737a4 100644
--- a/udev/libinput-model-quirks.c
+++ b/udev/libinput-model-quirks.c
@@ -69,6 +69,30 @@ handle_touchpad_alps(struct udev_device *device)
}
static void
+handle_touchpad_synaptics(struct udev_device *device)
+{
+ const char *product, *props;
+ int bus, vid, pid, version;
+ int prop;
+
+ product = prop_value(device, "PRODUCT");
+ if (!product)
+ return;
+
+ if (sscanf(product, "%x/%x/%x/%x", &bus, &vid, &pid, &version) != 4)
+ return;
+
+ if (bus != BUS_I8042 || vid != 0x2 || pid != 0x7)
+ return;
+
+ props = prop_value(device, "PROP");
+ if (sscanf(props, "%x", &prop) != 1)
+ return;
+ if (prop & (1 << INPUT_PROP_SEMI_MT))
+ printf("LIBINPUT_MODEL_JUMPING_SEMI_MT=1\n");
+}
+
+static void
handle_touchpad(struct udev_device *device)
{
const char *name = NULL;
@@ -79,6 +103,8 @@ handle_touchpad(struct udev_device *device)
if (strstr(name, "AlpsPS/2 ALPS") != NULL)
handle_touchpad_alps(device);
+ if (strstr(name, "Synaptics ") != NULL)
+ handle_touchpad_synaptics(device);
}
int main(int argc, char **argv)
--
2.4.3

View File

@ -4,8 +4,8 @@
%global gitversion 58abea394
Name: libinput
Version: 0.20.0
Release: 6%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist}
Version: 0.21.0
Release: 1%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist}
Summary: Input device library
License: MIT
@ -18,21 +18,8 @@ Source2: commitid
Source0: http://www.freedesktop.org/software/libinput/libinput-%{version}.tar.xz
%endif
Patch04: 0001-touchpad-only-edge-scroll-while-the-finger-is-in-the.patch
Patch05: 0001-udev-don-t-install-the-litest-udev-rules.patch
Patch06: 0001-evdev-restore-pointing-stick-const-accel-property-pa.patch
# Fedora-specific, remove when thumb detection is fixed upstream
Patch07: 0001-Disable-thumb-detection-it-s-too-aggressive-1246093.patch
# Bug 1235175 - Synaptics Touchpad two-finger scrolling jumps
Patch08: 0001-touchpad-remove-a-leftover-check-for-fake-resolution.patch
Patch09: 0002-evdev-allow-for-multiple-LIBINPUT_MODEL_-flags-per-d.patch
Patch10: 0003-Tag-synaptics-serial-touchpads-with-a-LIBINPUT_MODEL.patch
Patch11: 0004-touchpad-disable-2fg-scrolling-on-Synaptics-semi-mt-.patch
# Bug 1246651 - two-finger scroll stopped working with upgrade to 0.20.0-1
Patch12: 0001-udev-add-size-hint-for-appletouch-one-button-touchpa.patch
Patch13: 0002-gestures-check-ntouches-not-just-num_slots-for-the-n.patch
# Bug 1246868 Two finger scrolling does not work with first and fourth fingers (cf. Synaptics driver)
Patch14: 0001-touchpad-drop-distance-threshold-to-detect-pinches.patch
# Not upstream, keep until kernel 4.2 or 4.1.x with dbf3c37086
Patch01: 0001-touchpad-serial-synaptics-need-to-fake-new-touches-o.patch
BuildRequires: git
BuildRequires: autoconf automake libtool pkgconfig
@ -110,6 +97,10 @@ find $RPM_BUILD_ROOT -name '*.la' -delete
%changelog
* Tue Aug 04 2015 Peter Hutterer <peter.hutterer@redhat.com> 0.21.0-1
- libinput 0.21.0
- fix 3fg touch detection on Synaptics semi-mt touchpads
* Thu Jul 30 2015 Peter Hutterer <peter.hutterer@redhat.com> 0.20.0-6
- Fix broken 2fg scrolling on single-touch touchpads (#1246651)
- Drop distance threshold for 2fg gesture detection (#1246868)

View File

@ -1 +1 @@
444f3a4061be560310cb761cac6fa178 libinput-0.20.0.tar.xz
f91d8f4ced986f1ae16d52ea02bc7837 libinput-0.21.0.tar.xz