libinput 1.1.5

This commit is contained in:
Peter Hutterer 2016-01-25 14:55:47 +10:00
parent 7b227b778b
commit 8410ef24e2
6 changed files with 7 additions and 804 deletions

1
.gitignore vendored
View File

@ -29,3 +29,4 @@
/libinput-1.1.2.tar.xz
/libinput-1.1.3.tar.xz
/libinput-1.1.4.tar.xz
/libinput-1.1.5.tar.xz

View File

@ -1,132 +0,0 @@
From 7c231b7a1223b099ed15c35d703c6b9d4af1ab44 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue, 19 Jan 2016 09:05:31 +1000
Subject: [PATCH libinput] touchpad: disable MT for all semi-mt devices
Synaptics, Elantech and Alps semi-mt devices all have issues with reporting
correct MT data, even the bounding box which semi-mt devices are supposed to
report is wrong.
Synaptics devices have massive jumps with two fingers down. Elantech devices
may open slots without coordinate data. Alps devices may send 0/0 coordinates
as initial slot position.
All these may be addressable with specific quirks, but the actual benefit is
largely restricted to better palm detection (though even with quirks this is
unlikely to work) and support for pinch gestures (again, lack of coordinates
makes supporting those hard anyway).
Elantech: https://bugs.freedesktop.org/show_bug.cgi?id=93583
Alps: https://bugzilla.redhat.com/show_bug.cgi?id=1295073
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
---
src/evdev-mt-touchpad-gestures.c | 6 ++----
src/evdev-mt-touchpad.c | 21 +++++++++++++--------
test/gestures.c | 2 +-
test/litest.h | 10 ----------
test/touchpad-tap.c | 2 +-
5 files changed, 17 insertions(+), 24 deletions(-)
diff --git a/src/evdev-mt-touchpad-gestures.c b/src/evdev-mt-touchpad-gestures.c
index 80aa89f..24f6a6d 100644
--- a/src/evdev-mt-touchpad-gestures.c
+++ b/src/evdev-mt-touchpad-gestures.c
@@ -568,10 +568,8 @@ tp_gesture_handle_state(struct tp_dispatch *tp, uint64_t time)
int
tp_init_gesture(struct tp_dispatch *tp)
{
- if (tp->device->model_flags & EVDEV_MODEL_JUMPING_SEMI_MT)
- tp->gesture.enabled = false;
- else
- tp->gesture.enabled = true;
+ /* semi-mt devices are too unreliable to do pinch gestures */
+ tp->gesture.enabled = !tp->semi_mt;
tp->gesture.twofinger_state = GESTURE_2FG_STATE_NONE;
diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index 62087fb..7f5bbf5 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -1490,17 +1490,22 @@ tp_init_slots(struct tp_dispatch *tp,
tp->semi_mt = libevdev_has_property(device->evdev, INPUT_PROP_SEMI_MT);
- /* This device has a terrible resolution when two fingers are down,
+ /* Semi-mt devices are not reliable for true multitouch data, so we
+ * simply pretend they're single touch touchpads with BTN_TOOL bits.
+ * Synaptics:
+ * Terrible resolution when two fingers are down,
* causing scroll jumps. The single-touch emulation ABS_X/Y is
* accurate but the ABS_MT_POSITION touchpoints report the bounding
- * box and that causes jumps. So we simply pretend it's a single
- * touch touchpad with the BTN_TOOL bits.
- * See https://bugzilla.redhat.com/show_bug.cgi?id=1235175 for an
- * explanation.
+ * box and that causes jumps. See https://bugzilla.redhat.com/1235175
+ * Elantech:
+ * On three-finger taps/clicks, one slot doesn't get a coordinate
+ * assigned. See https://bugs.freedesktop.org/show_bug.cgi?id=93583
+ * Alps:
+ * 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
*/
- if (tp->semi_mt &&
- (device->model_flags &
- (EVDEV_MODEL_JUMPING_SEMI_MT|EVDEV_MODEL_ELANTECH_TOUCHPAD))) {
+ if (tp->semi_mt) {
tp->num_slots = 1;
tp->slot = 0;
tp->has_mt = false;
diff --git a/test/gestures.c b/test/gestures.c
index 9fc73b9..0fc3964 100644
--- a/test/gestures.c
+++ b/test/gestures.c
@@ -34,7 +34,7 @@ START_TEST(gestures_cap)
struct litest_device *dev = litest_current_device();
struct libinput_device *device = dev->libinput_device;
- if (litest_is_synaptics_semi_mt(dev))
+ if (libevdev_has_property(dev->evdev, INPUT_PROP_SEMI_MT))
ck_assert(!libinput_device_has_capability(device,
LIBINPUT_DEVICE_CAP_GESTURE));
else
diff --git a/test/litest.h b/test/litest.h
index e74e923..61b1b01 100644
--- a/test/litest.h
+++ b/test/litest.h
@@ -552,16 +552,6 @@ litest_enable_buttonareas(struct litest_device *dev)
litest_assert_int_eq(status, expected);
}
-static inline int
-litest_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;
-}
-
static inline void
litest_enable_drag_lock(struct libinput_device *device)
{
diff --git a/test/touchpad-tap.c b/test/touchpad-tap.c
index 4450ec3..7a7e64c 100644
--- a/test/touchpad-tap.c
+++ b/test/touchpad-tap.c
@@ -241,7 +241,7 @@ START_TEST(touchpad_1fg_multitap_n_drag_2fg)
int range = _i,
ntaps;
- if (litest_is_synaptics_semi_mt(dev))
+ if (libevdev_has_property(dev->evdev, INPUT_PROP_SEMI_MT))
return;
litest_enable_tap(dev->libinput_device);
--
2.5.0

View File

@ -1,38 +0,0 @@
From 556aac04b5d56f015d5da8b96e24fd78ad231760 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue, 12 Jan 2016 12:24:18 +1000
Subject: [PATCH libinput] touchpad: disable MT for elantech semi-mt touchpads
When three fingers are set down on the touchpad, one finger tends to get a 0/0
coordinate, triggering palm detection in the upper left corner. Handle this
like the jumping semi-mt touchpads and disable MT handling and instead
just rely on the x/y axis and the BTN_TOOL_* events.
https://bugs.freedesktop.org/show_bug.cgi?id=93583
This kernel patch is required:
https://lkml.org/lkml/2016/1/11/171
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
src/evdev-mt-touchpad.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index 2de2539..f91f839 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -1496,7 +1496,8 @@ tp_init_slots(struct tp_dispatch *tp,
* explanation.
*/
if (tp->semi_mt &&
- (device->model_flags & EVDEV_MODEL_JUMPING_SEMI_MT)) {
+ (device->model_flags &
+ (EVDEV_MODEL_JUMPING_SEMI_MT|EVDEV_MODEL_ELANTECH_TOUCHPAD))) {
tp->num_slots = 1;
tp->slot = 0;
tp->has_mt = false;
--
2.5.0

View File

@ -1,627 +0,0 @@
From b3f11180e337d6cd7fd997685b65e5ed48acc661 Mon Sep 17 00:00:00 2001
From: Caibin Chen <tigersoldi@gmail.com>
Date: Sun, 13 Dec 2015 22:27:55 -0800
Subject: [PATCH libinput] touchpad: fix DWT pairing for Macbook Pro 2015
Label internal keyboards through the udev hwdb and only pair the internal
(usb) Apple touchpads with those keyboards labelled as such.
https://bugs.freedesktop.org/show_bug.cgi?id=93367
Co-authored-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
src/evdev-mt-touchpad.c | 9 +
src/evdev.c | 1 +
src/evdev.h | 1 +
src/libinput-util.h | 1 +
test/Makefile.am | 1 +
test/litest-device-apple-internal-keyboard.c | 239 +++++++++++++++++++++++++++
test/litest.c | 2 +
test/litest.h | 1 +
test/touchpad.c | 87 ++++++++--
udev/90-libinput-model-quirks.hwdb | 3 +
10 files changed, 328 insertions(+), 17 deletions(-)
create mode 100644 test/litest-device-apple-internal-keyboard.c
diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index d78a54b..aa123cd 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -1285,6 +1285,8 @@ tp_want_dwt(struct evdev_device *touchpad,
{
unsigned int bus_tp = libevdev_get_id_bustype(touchpad->evdev),
bus_kbd = libevdev_get_id_bustype(keyboard->evdev);
+ unsigned int vendor_tp = evdev_device_get_id_vendor(touchpad);
+ unsigned int vendor_kbd = evdev_device_get_id_vendor(keyboard);
if (tp_dwt_device_is_blacklisted(touchpad) ||
tp_dwt_device_is_blacklisted(keyboard))
@@ -1295,6 +1297,13 @@ tp_want_dwt(struct evdev_device *touchpad,
if (bus_tp == BUS_I8042 && bus_kbd != bus_tp)
return false;
+ /* For Apple touchpads, always use its internal keyboard */
+ if (vendor_tp == VENDOR_ID_APPLE) {
+ return vendor_kbd == vendor_tp &&
+ keyboard->model_flags &
+ EVDEV_MODEL_APPLE_INTERNAL_KEYBOARD;
+ }
+
/* everything else we don't really know, so we have to assume
they go together */
diff --git a/src/evdev.c b/src/evdev.c
index 3708072..a6d8a60 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1662,6 +1662,7 @@ evdev_read_model_flags(struct evdev_device *device)
{ "LIBINPUT_MODEL_SYNAPTICS_SERIAL_TOUCHPAD", EVDEV_MODEL_SYNAPTICS_SERIAL_TOUCHPAD },
{ "LIBINPUT_MODEL_JUMPING_SEMI_MT", EVDEV_MODEL_JUMPING_SEMI_MT },
{ "LIBINPUT_MODEL_ELANTECH_TOUCHPAD", EVDEV_MODEL_ELANTECH_TOUCHPAD },
+ { "LIBINPUT_MODEL_APPLE_INTERNAL_KEYBOARD", EVDEV_MODEL_APPLE_INTERNAL_KEYBOARD },
{ NULL, EVDEV_MODEL_DEFAULT },
};
const struct model_map *m = model_map;
diff --git a/src/evdev.h b/src/evdev.h
index 36bf7b4..97177ec 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -108,6 +108,7 @@ enum evdev_device_model {
EVDEV_MODEL_JUMPING_SEMI_MT = (1 << 10),
EVDEV_MODEL_ELANTECH_TOUCHPAD = (1 << 11),
EVDEV_MODEL_LENOVO_X220_TOUCHPAD_FW81 = (1 << 12),
+ EVDEV_MODEL_APPLE_INTERNAL_KEYBOARD = (1 << 13),
};
struct mt_slot {
diff --git a/src/libinput-util.h b/src/libinput-util.h
index a627e5d..25de8e5 100644
--- a/src/libinput-util.h
+++ b/src/libinput-util.h
@@ -38,6 +38,7 @@
#define VENDOR_ID_APPLE 0x5ac
#define VENDOR_ID_WACOM 0x56a
#define VENDOR_ID_SYNAPTICS_SERIAL 0x002
+#define PRODUCT_ID_APPLE_KBD_TOUCHPAD 0x273
#define PRODUCT_ID_SYNAPTICS_SERIAL 0x007
/* The HW DPI rate we normalize to before calculating pointer acceleration */
diff --git a/test/Makefile.am b/test/Makefile.am
index e4ed8e5..3b18cf4 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -15,6 +15,7 @@ liblitest_la_SOURCES = \
litest-int.h \
litest-device-alps-semi-mt.c \
litest-device-alps-dualpoint.c \
+ litest-device-apple-internal-keyboard.c \
litest-device-asus-rog-gladius.c \
litest-device-atmel-hover.c \
litest-device-bcm5974.c \
diff --git a/test/litest-device-apple-internal-keyboard.c b/test/litest-device-apple-internal-keyboard.c
new file mode 100644
index 0000000..c24403d
--- /dev/null
+++ b/test/litest-device-apple-internal-keyboard.c
@@ -0,0 +1,239 @@
+/*
+ * Copyright © 2015 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "litest.h"
+#include "litest-int.h"
+
+static void litest_apple_keyboard_setup(void)
+{
+ struct litest_device *d = litest_create_device(LITEST_APPLE_KEYBOARD);
+ litest_set_current_device(d);
+}
+
+static struct input_id input_id = {
+ .bustype = 0x3,
+ .vendor = 0x5ac,
+ .product = 0x273,
+};
+
+static int events[] = {
+ EV_KEY, KEY_ESC,
+ EV_KEY, KEY_1,
+ EV_KEY, KEY_2,
+ EV_KEY, KEY_3,
+ EV_KEY, KEY_4,
+ EV_KEY, KEY_5,
+ EV_KEY, KEY_6,
+ EV_KEY, KEY_7,
+ EV_KEY, KEY_8,
+ EV_KEY, KEY_9,
+ EV_KEY, KEY_0,
+ EV_KEY, KEY_MINUS,
+ EV_KEY, KEY_EQUAL,
+ EV_KEY, KEY_BACKSPACE,
+ EV_KEY, KEY_TAB,
+ EV_KEY, KEY_Q,
+ EV_KEY, KEY_W,
+ EV_KEY, KEY_E,
+ EV_KEY, KEY_R,
+ EV_KEY, KEY_T,
+ EV_KEY, KEY_Y,
+ EV_KEY, KEY_U,
+ EV_KEY, KEY_I,
+ EV_KEY, KEY_O,
+ EV_KEY, KEY_P,
+ EV_KEY, KEY_LEFTBRACE,
+ EV_KEY, KEY_RIGHTBRACE,
+ EV_KEY, KEY_ENTER,
+ EV_KEY, KEY_LEFTCTRL,
+ EV_KEY, KEY_A,
+ EV_KEY, KEY_S,
+ EV_KEY, KEY_D,
+ EV_KEY, KEY_F,
+ EV_KEY, KEY_G,
+ EV_KEY, KEY_H,
+ EV_KEY, KEY_J,
+ EV_KEY, KEY_K,
+ EV_KEY, KEY_L,
+ EV_KEY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E,
+ EV_KEY, KEY_PREVIOUSSONG,
+ EV_KEY, KEY_STOPCD,
+ EV_KEY, KEY_REWIND,
+ EV_KEY, KEY_REFRESH,
+ EV_KEY, KEY_EDIT,
+ EV_KEY, KEY_SCROLLUP,
+ EV_KEY, KEY_SCROLLDOWN,
+ EV_KEY, KEY_KPLEFTPAREN,
+ EV_KEY, KEY_KPRIGHTPAREN,
+ EV_KEY, KEY_F13,
+ EV_KEY, KEY_F14,
+ EV_KEY, KEY_F15,
+ EV_KEY, KEY_F16,
+ EV_KEY, KEY_F17,
+ EV_KEY, KEY_F18,
+ EV_KEY, KEY_F19,
+ EV_KEY, KEY_F20,
+ EV_KEY, KEY_F21,
+ EV_KEY, KEY_F22,
+ EV_KEY, KEY_F23,
+ EV_KEY, KEY_F24,
+ EV_KEY, KEY_DASHBOARD,
+ EV_KEY, KEY_FASTFORWARD,
+ EV_KEY, KEY_BRIGHTNESSDOWN,
+ EV_KEY, KEY_BRIGHTNESSUP,
+ EV_KEY, KEY_SWITCHVIDEOMODE,
+ EV_KEY, KEY_KBDILLUMTOGGLE,
+ EV_KEY, KEY_KBDILLUMDOWN,
+ EV_KEY, KEY_KBDILLUMUP,
+ EV_KEY, KEY_UNKNOWN,
+ EV_KEY, KEY_FN,
+ EV_MSC, MSC_SCAN,
+
+ EV_LED, LED_NUML,
+ EV_LED, LED_CAPSL,
+ EV_LED, LED_SCROLLL,
+ EV_LED, LED_COMPOSE,
+ EV_LED, LED_KANA,
+ -1, -1
+};
+
+struct litest_test_device litest_apple_keyboard_device = {
+ .type = LITEST_APPLE_KEYBOARD,
+ .features = LITEST_KEYS,
+ .shortname = "apple_keyboard",
+ .setup = litest_apple_keyboard_setup,
+ .interface = NULL,
+
+ .name = "Apple Inc. Apple Internal Keyboard / Trackpad",
+ .id = &input_id,
+ .events = events,
+ .absinfo = NULL,
+};
diff --git a/test/litest.c b/test/litest.c
index fc188b6..0e3a815 100644
--- a/test/litest.c
+++ b/test/litest.c
@@ -367,6 +367,7 @@ extern struct litest_test_device litest_magicpad_device;
extern struct litest_test_device litest_elantech_touchpad_device;
extern struct litest_test_device litest_mouse_gladius_device;
extern struct litest_test_device litest_mouse_wheel_click_angle_device;
+extern struct litest_test_device litest_apple_keyboard_device;
struct litest_test_device* devices[] = {
&litest_synaptics_clickpad_device,
@@ -400,6 +401,7 @@ struct litest_test_device* devices[] = {
&litest_elantech_touchpad_device,
&litest_mouse_gladius_device,
&litest_mouse_wheel_click_angle_device,
+ &litest_apple_keyboard_device,
NULL,
};
diff --git a/test/litest.h b/test/litest.h
index 1268e10..7cd550e 100644
--- a/test/litest.h
+++ b/test/litest.h
@@ -144,6 +144,7 @@ enum litest_device_type {
LITEST_ELANTECH_TOUCHPAD = -30,
LITEST_MOUSE_GLADIUS = -31,
LITEST_MOUSE_WHEEL_CLICK_ANGLE = -32,
+ LITEST_APPLE_KEYBOARD = -33,
};
enum litest_device_feature {
diff --git a/test/touchpad.c b/test/touchpad.c
index dab2781..4eb9418 100644
--- a/test/touchpad.c
+++ b/test/touchpad.c
@@ -2282,6 +2282,18 @@ has_disable_while_typing(struct litest_device *device)
return libinput_device_config_dwt_is_available(device->libinput_device);
}
+static inline struct litest_device *
+dwt_init_paired_keyboard(struct libinput *li,
+ struct litest_device *touchpad)
+{
+ enum litest_device_type which = LITEST_KEYBOARD;
+
+ if (libevdev_get_id_vendor(touchpad->evdev) == VENDOR_ID_APPLE)
+ which = LITEST_APPLE_KEYBOARD;
+
+ return litest_add_device(li, which);
+}
+
START_TEST(touchpad_dwt)
{
struct litest_device *touchpad = litest_current_device();
@@ -2291,7 +2303,7 @@ START_TEST(touchpad_dwt)
if (!has_disable_while_typing(touchpad))
return;
- keyboard = litest_add_device(li, LITEST_KEYBOARD);
+ keyboard = dwt_init_paired_keyboard(li, touchpad);
litest_disable_tap(touchpad->libinput_device);
litest_drain_events(li);
@@ -2333,7 +2345,7 @@ START_TEST(touchpad_dwt_enable_touch)
if (!has_disable_while_typing(touchpad))
return;
- keyboard = litest_add_device(li, LITEST_KEYBOARD);
+ keyboard = dwt_init_paired_keyboard(li, touchpad);
litest_disable_tap(touchpad->libinput_device);
litest_drain_events(li);
@@ -2371,7 +2383,7 @@ START_TEST(touchpad_dwt_touch_hold)
if (!has_disable_while_typing(touchpad))
return;
- keyboard = litest_add_device(li, LITEST_KEYBOARD);
+ keyboard = dwt_init_paired_keyboard(li, touchpad);
litest_disable_tap(touchpad->libinput_device);
litest_drain_events(li);
@@ -2408,7 +2420,7 @@ START_TEST(touchpad_dwt_key_hold)
if (!has_disable_while_typing(touchpad))
return;
- keyboard = litest_add_device(li, LITEST_KEYBOARD);
+ keyboard = dwt_init_paired_keyboard(li, touchpad);
litest_disable_tap(touchpad->libinput_device);
litest_drain_events(li);
@@ -2436,7 +2448,7 @@ START_TEST(touchpad_dwt_type)
if (!has_disable_while_typing(touchpad))
return;
- keyboard = litest_add_device(li, LITEST_KEYBOARD);
+ keyboard = dwt_init_paired_keyboard(li, touchpad);
litest_disable_tap(touchpad->libinput_device);
litest_drain_events(li);
@@ -2474,7 +2486,7 @@ START_TEST(touchpad_dwt_type_short_timeout)
if (!has_disable_while_typing(touchpad))
return;
- keyboard = litest_add_device(li, LITEST_KEYBOARD);
+ keyboard = dwt_init_paired_keyboard(li, touchpad);
litest_disable_tap(touchpad->libinput_device);
litest_drain_events(li);
@@ -2511,7 +2523,7 @@ START_TEST(touchpad_dwt_tap)
if (!has_disable_while_typing(touchpad))
return;
- keyboard = litest_add_device(li, LITEST_KEYBOARD);
+ keyboard = dwt_init_paired_keyboard(li, touchpad);
litest_enable_tap(touchpad->libinput_device);
litest_drain_events(li);
@@ -2541,7 +2553,7 @@ START_TEST(touchpad_dwt_tap_drag)
if (!has_disable_while_typing(touchpad))
return;
- keyboard = litest_add_device(li, LITEST_KEYBOARD);
+ keyboard = dwt_init_paired_keyboard(li, touchpad);
litest_enable_tap(touchpad->libinput_device);
litest_drain_events(li);
@@ -2575,7 +2587,7 @@ START_TEST(touchpad_dwt_click)
if (!has_disable_while_typing(touchpad))
return;
- keyboard = litest_add_device(li, LITEST_KEYBOARD);
+ keyboard = dwt_init_paired_keyboard(li, touchpad);
litest_disable_tap(touchpad->libinput_device);
litest_drain_events(li);
@@ -2608,7 +2620,7 @@ START_TEST(touchpad_dwt_edge_scroll)
litest_enable_edge_scroll(touchpad);
- keyboard = litest_add_device(li, LITEST_KEYBOARD);
+ keyboard = dwt_init_paired_keyboard(li, touchpad);
litest_drain_events(li);
litest_keyboard_key(keyboard, KEY_A, true);
@@ -2655,7 +2667,7 @@ START_TEST(touchpad_dwt_edge_scroll_interrupt)
litest_enable_edge_scroll(touchpad);
- keyboard = litest_add_device(li, LITEST_KEYBOARD);
+ keyboard = dwt_init_paired_keyboard(li, touchpad);
litest_drain_events(li);
litest_touch_down(touchpad, 0, 99, 20);
@@ -2779,7 +2791,7 @@ START_TEST(touchpad_dwt_disabled)
disable_dwt(touchpad);
- keyboard = litest_add_device(li, LITEST_KEYBOARD);
+ keyboard = dwt_init_paired_keyboard(li, touchpad);
litest_disable_tap(touchpad->libinput_device);
litest_drain_events(li);
@@ -2808,7 +2820,7 @@ START_TEST(touchpad_dwt_disable_during_touch)
enable_dwt(touchpad);
- keyboard = litest_add_device(li, LITEST_KEYBOARD);
+ keyboard = dwt_init_paired_keyboard(li, touchpad);
litest_disable_tap(touchpad->libinput_device);
litest_drain_events(li);
@@ -2843,7 +2855,7 @@ START_TEST(touchpad_dwt_disable_before_touch)
enable_dwt(touchpad);
- keyboard = litest_add_device(li, LITEST_KEYBOARD);
+ keyboard = dwt_init_paired_keyboard(li, touchpad);
litest_disable_tap(touchpad->libinput_device);
litest_drain_events(li);
@@ -2874,7 +2886,7 @@ START_TEST(touchpad_dwt_enable_during_touch)
disable_dwt(touchpad);
- keyboard = litest_add_device(li, LITEST_KEYBOARD);
+ keyboard = dwt_init_paired_keyboard(li, touchpad);
litest_disable_tap(touchpad->libinput_device);
litest_drain_events(li);
@@ -2908,7 +2920,7 @@ START_TEST(touchpad_dwt_enable_before_touch)
disable_dwt(touchpad);
- keyboard = litest_add_device(li, LITEST_KEYBOARD);
+ keyboard = dwt_init_paired_keyboard(li, touchpad);
litest_disable_tap(touchpad->libinput_device);
litest_drain_events(li);
@@ -2939,7 +2951,7 @@ START_TEST(touchpad_dwt_enable_during_tap)
litest_enable_tap(touchpad->libinput_device);
disable_dwt(touchpad);
- keyboard = litest_add_device(li, LITEST_KEYBOARD);
+ keyboard = dwt_init_paired_keyboard(li, touchpad);
litest_drain_events(li);
litest_keyboard_key(keyboard, KEY_A, true);
@@ -2964,6 +2976,46 @@ START_TEST(touchpad_dwt_enable_during_tap)
litest_delete_device(keyboard);
}
END_TEST
+
+START_TEST(touchpad_dwt_apple)
+{
+ struct litest_device *touchpad = litest_current_device();
+ struct litest_device *keyboard, *apple_keyboard;
+ struct libinput *li = touchpad->libinput;
+
+ ck_assert(has_disable_while_typing(touchpad));
+
+ /* Only the apple keyboard can trigger DWT */
+ keyboard = litest_add_device(li, LITEST_KEYBOARD);
+ litest_drain_events(li);
+
+ litest_keyboard_key(keyboard, KEY_A, true);
+ litest_keyboard_key(keyboard, KEY_A, false);
+ litest_assert_only_typed_events(li, LIBINPUT_EVENT_KEYBOARD_KEY);
+
+ litest_touch_down(touchpad, 0, 50, 50);
+ litest_touch_move_to(touchpad, 0, 50, 50, 70, 50, 10, 1);
+ litest_touch_up(touchpad, 0);
+ litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
+
+ apple_keyboard = litest_add_device(li, LITEST_APPLE_KEYBOARD);
+ litest_drain_events(li);
+
+ litest_keyboard_key(apple_keyboard, KEY_A, true);
+ litest_keyboard_key(apple_keyboard, KEY_A, false);
+ litest_assert_only_typed_events(li, LIBINPUT_EVENT_KEYBOARD_KEY);
+
+ litest_touch_down(touchpad, 0, 50, 50);
+ litest_touch_move_to(touchpad, 0, 50, 50, 70, 50, 10, 1);
+ litest_touch_up(touchpad, 0);
+ libinput_dispatch(li);
+ litest_assert_empty_queue(li);
+
+ litest_delete_device(keyboard);
+ litest_delete_device(apple_keyboard);
+}
+END_TEST
+
static int
has_thumb_detect(struct litest_device *dev)
{
@@ -3632,6 +3684,7 @@ litest_setup_tests(void)
litest_add("touchpad:dwt", touchpad_dwt_enable_during_touch, LITEST_TOUCHPAD, LITEST_ANY);
litest_add("touchpad:dwt", touchpad_dwt_enable_before_touch, LITEST_TOUCHPAD, LITEST_ANY);
litest_add("touchpad:dwt", touchpad_dwt_enable_during_tap, LITEST_TOUCHPAD, LITEST_ANY);
+ litest_add_for_device("touchpad:dwt", touchpad_dwt_apple, LITEST_BCM5974);
litest_add("touchpad:thumb", touchpad_thumb_begin_no_motion, LITEST_CLICKPAD, LITEST_ANY);
litest_add("touchpad:thumb", touchpad_thumb_update_no_motion, LITEST_CLICKPAD, LITEST_ANY);
diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb
index 814ec40..baebcb3 100644
--- a/udev/90-libinput-model-quirks.hwdb
+++ b/udev/90-libinput-model-quirks.hwdb
@@ -34,6 +34,9 @@ libinput:touchpad:input:b0005v05ACp*
LIBINPUT_MODEL_APPLE_TOUCHPAD=1
LIBINPUT_ATTR_SIZE_HINT=104x75
+libinput:name:*Apple Inc. Apple Internal Keyboard*:dmi:*
+ LIBINPUT_MODEL_APPLE_INTERNAL_KEYBOARD=1
+
##########################################
# Elantech
##########################################
--
2.5.0

View File

@ -4,8 +4,8 @@
%global gitversion 58abea394
Name: libinput
Version: 1.1.4
Release: 3%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist}
Version: 1.1.5
Release: 1%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist}
Summary: Input device library
License: MIT
@ -21,10 +21,6 @@ Source0: http://www.freedesktop.org/software/libinput/libinput-%{version}
# 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
Patch02: 0001-touchpad-fix-DWT-pairing-for-Macbook-Pro-2015.patch
Patch03: 0001-touchpad-disable-MT-for-elantech-semi-mt-touchpads.patch
Patch04: 0001-touchpad-disable-MT-for-all-semi-mt-devices.patch
BuildRequires: git
BuildRequires: autoconf automake libtool pkgconfig
BuildRequires: libevdev-devel
@ -101,6 +97,9 @@ find $RPM_BUILD_ROOT -name '*.la' -delete
%changelog
* Mon Jan 25 2016 Peter Hutterer <peter.hutterer@redhat.com> 1.1.5-1
- libinput 1.1.5
* Tue Jan 19 2016 Peter Hutterer <peter.hutterer@redhat.com> 1.1.4-3
- disable MT for semi-mt devices to solve the various two- and three-finger
issues (at the cost of pinch gestures) (#1295073)

View File

@ -1 +1 @@
0945318141c1a9f52857bbf65d175f32 libinput-1.1.4.tar.xz
5d730cdb43aadee55145d0cf60430fa3 libinput-1.1.5.tar.xz