From cdbbf32d3a4ec176262e1f9309a6c646b08deb27 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 7 Sep 2017 17:21:10 +1000 Subject: [PATCH] libinput 1.8.2 --- .gitignore | 1 + ...on-t-try-to-pinch-for-nfingers-slots.patch | 282 ------------------ libinput.spec | 8 +- sources | 2 +- 4 files changed, 7 insertions(+), 286 deletions(-) delete mode 100644 0001-gestures-don-t-try-to-pinch-for-nfingers-slots.patch diff --git a/.gitignore b/.gitignore index fd38a3d..64164f2 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /libinput-1.7.902.tar.xz /libinput-1.8.0.tar.xz /libinput-1.8.1.tar.xz +/libinput-1.8.2.tar.xz diff --git a/0001-gestures-don-t-try-to-pinch-for-nfingers-slots.patch b/0001-gestures-don-t-try-to-pinch-for-nfingers-slots.patch deleted file mode 100644 index 2a589dc..0000000 --- a/0001-gestures-don-t-try-to-pinch-for-nfingers-slots.patch +++ /dev/null @@ -1,282 +0,0 @@ -From a7e79ed5a69556c71bb9dd2f0047e4833affa929 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Sat, 29 Jul 2017 13:59:40 +0100 -Subject: [PATCH libinput] gestures: don't try to pinch for nfingers > slots - -We don't know the position of the third finger on 2-slot touchpads, differing -between swipe and pinch is reliable. Simply disable 3-finger pinch and always -use swipe; 3fg pinch is uncommon anyway and it's better to have one of the -gestures working reliably than both unreliably. - -Signed-off-by: Peter Hutterer -Reviewed-by: Hans de Goede ---- - src/evdev-mt-touchpad-gestures.c | 7 +- - test/test-gestures.c | 211 --------------------------------------- - 2 files changed, 6 insertions(+), 212 deletions(-) - -diff --git a/src/evdev-mt-touchpad-gestures.c b/src/evdev-mt-touchpad-gestures.c -index a20b26d4..26bdef5a 100644 ---- a/src/evdev-mt-touchpad-gestures.c -+++ b/src/evdev-mt-touchpad-gestures.c -@@ -334,6 +334,10 @@ tp_gesture_handle_state_unknown(struct tp_dispatch *tp, uint64_t time) - if (tp->gesture.finger_count == 2) { - tp_gesture_set_scroll_buildup(tp); - return GESTURE_STATE_SCROLL; -+ /* more fingers than slots, don't bother with pinch, always -+ * assume swipe */ -+ } else if (tp->gesture.finger_count > tp->num_slots) { -+ return GESTURE_STATE_SWIPE; - } - - /* for 3+ finger gestures, check if one finger is > 20mm -@@ -356,7 +360,8 @@ tp_gesture_handle_state_unknown(struct tp_dispatch *tp, uint64_t time) - - /* If both touches are moving in the same direction assume - * scroll or swipe */ -- if (tp_gesture_same_directions(dir1, dir2)) { -+ if (tp->gesture.finger_count > tp->num_slots || -+ tp_gesture_same_directions(dir1, dir2)) { - if (tp->gesture.finger_count == 2) { - tp_gesture_set_scroll_buildup(tp); - return GESTURE_STATE_SCROLL; -diff --git a/test/test-gestures.c b/test/test-gestures.c -index ce1012d4..e95d1a01 100644 ---- a/test/test-gestures.c -+++ b/test/test-gestures.c -@@ -754,110 +754,6 @@ START_TEST(gestures_pinch_3fg) - } - END_TEST - --START_TEST(gestures_pinch_3fg_btntool) --{ -- struct litest_device *dev = litest_current_device(); -- struct libinput *li = dev->libinput; -- struct libinput_event *event; -- struct libinput_event_gesture *gevent; -- double dx, dy; -- int cardinal = _i; /* ranged test */ -- double dir_x, dir_y; -- int i; -- double scale, oldscale; -- double angle; -- int cardinals[8][2] = { -- { 0, 30 }, -- { 30, 30 }, -- { 30, 0 }, -- { 30, -30 }, -- { 0, -30 }, -- { -30, -30 }, -- { -30, 0 }, -- { -30, 30 }, -- }; -- -- if (libevdev_get_num_slots(dev->evdev) > 2 || -- !libinput_device_has_capability(dev->libinput_device, -- LIBINPUT_DEVICE_CAP_GESTURE)) -- return; -- -- dir_x = cardinals[cardinal][0]; -- dir_y = cardinals[cardinal][1]; -- -- litest_drain_events(li); -- -- litest_touch_down(dev, 0, 50 + dir_x, 50 + dir_y); -- litest_touch_down(dev, 1, 50 - dir_x, 50 - dir_y); -- litest_event(dev, EV_KEY, BTN_TOOL_DOUBLETAP, 0); -- litest_event(dev, EV_KEY, BTN_TOOL_TRIPLETAP, 1); -- litest_event(dev, EV_SYN, SYN_REPORT, 0); -- libinput_dispatch(li); -- -- for (i = 0; i < 8; i++) { -- litest_push_event_frame(dev); -- if (dir_x > 0.0) -- dir_x -= 2; -- else if (dir_x < 0.0) -- dir_x += 2; -- if (dir_y > 0.0) -- dir_y -= 2; -- else if (dir_y < 0.0) -- dir_y += 2; -- litest_touch_move(dev, -- 0, -- 50 + dir_x, -- 50 + dir_y); -- litest_touch_move(dev, -- 1, -- 50 - dir_x, -- 50 - dir_y); -- litest_pop_event_frame(dev); -- libinput_dispatch(li); -- } -- -- event = libinput_get_event(li); -- gevent = litest_is_gesture_event(event, -- LIBINPUT_EVENT_GESTURE_PINCH_BEGIN, -- 3); -- dx = libinput_event_gesture_get_dx(gevent); -- dy = libinput_event_gesture_get_dy(gevent); -- scale = libinput_event_gesture_get_scale(gevent); -- ck_assert(dx == 0.0); -- ck_assert(dy == 0.0); -- ck_assert(scale == 1.0); -- -- libinput_event_destroy(event); -- -- while ((event = libinput_get_event(li)) != NULL) { -- gevent = litest_is_gesture_event(event, -- LIBINPUT_EVENT_GESTURE_PINCH_UPDATE, -- 3); -- -- oldscale = scale; -- scale = libinput_event_gesture_get_scale(gevent); -- -- ck_assert(scale < oldscale); -- -- angle = libinput_event_gesture_get_angle_delta(gevent); -- ck_assert_double_le(fabs(angle), 1.0); -- -- libinput_event_destroy(event); -- libinput_dispatch(li); -- } -- -- litest_touch_up(dev, 0); -- litest_touch_up(dev, 1); -- libinput_dispatch(li); -- event = libinput_get_event(li); -- gevent = litest_is_gesture_event(event, -- LIBINPUT_EVENT_GESTURE_PINCH_END, -- 3); -- ck_assert(!libinput_event_gesture_get_cancelled(gevent)); -- libinput_event_destroy(event); --} --END_TEST -- - START_TEST(gestures_pinch_4fg) - { - struct litest_device *dev = litest_current_device(); -@@ -969,111 +865,6 @@ START_TEST(gestures_pinch_4fg) - } - END_TEST - --START_TEST(gestures_pinch_4fg_btntool) --{ -- struct litest_device *dev = litest_current_device(); -- struct libinput *li = dev->libinput; -- struct libinput_event *event; -- struct libinput_event_gesture *gevent; -- double dx, dy; -- int cardinal = _i; /* ranged test */ -- double dir_x, dir_y; -- int i; -- double scale, oldscale; -- double angle; -- int cardinals[8][2] = { -- { 0, 30 }, -- { 30, 30 }, -- { 30, 0 }, -- { 30, -30 }, -- { 0, -30 }, -- { -30, -30 }, -- { -30, 0 }, -- { -30, 30 }, -- }; -- -- if (libevdev_get_num_slots(dev->evdev) > 2 || -- !libevdev_has_event_code(dev->evdev, EV_KEY, BTN_TOOL_QUADTAP) || -- !libinput_device_has_capability(dev->libinput_device, -- LIBINPUT_DEVICE_CAP_GESTURE)) -- return; -- -- dir_x = cardinals[cardinal][0]; -- dir_y = cardinals[cardinal][1]; -- -- litest_drain_events(li); -- -- litest_touch_down(dev, 0, 50 + dir_x, 50 + dir_y); -- litest_touch_down(dev, 1, 50 - dir_x, 50 - dir_y); -- litest_event(dev, EV_KEY, BTN_TOOL_DOUBLETAP, 0); -- litest_event(dev, EV_KEY, BTN_TOOL_QUADTAP, 1); -- litest_event(dev, EV_SYN, SYN_REPORT, 0); -- libinput_dispatch(li); -- -- for (i = 0; i < 8; i++) { -- litest_push_event_frame(dev); -- if (dir_x > 0.0) -- dir_x -= 3; -- else if (dir_x < 0.0) -- dir_x += 3; -- if (dir_y > 0.0) -- dir_y -= 3; -- else if (dir_y < 0.0) -- dir_y += 3; -- litest_touch_move(dev, -- 0, -- 50 + dir_x, -- 50 + dir_y); -- litest_touch_move(dev, -- 1, -- 50 - dir_x, -- 50 - dir_y); -- litest_pop_event_frame(dev); -- libinput_dispatch(li); -- } -- -- event = libinput_get_event(li); -- gevent = litest_is_gesture_event(event, -- LIBINPUT_EVENT_GESTURE_PINCH_BEGIN, -- 4); -- dx = libinput_event_gesture_get_dx(gevent); -- dy = libinput_event_gesture_get_dy(gevent); -- scale = libinput_event_gesture_get_scale(gevent); -- ck_assert(dx == 0.0); -- ck_assert(dy == 0.0); -- ck_assert(scale == 1.0); -- -- libinput_event_destroy(event); -- -- while ((event = libinput_get_event(li)) != NULL) { -- gevent = litest_is_gesture_event(event, -- LIBINPUT_EVENT_GESTURE_PINCH_UPDATE, -- 4); -- -- oldscale = scale; -- scale = libinput_event_gesture_get_scale(gevent); -- -- ck_assert(scale < oldscale); -- -- angle = libinput_event_gesture_get_angle_delta(gevent); -- ck_assert_double_le(fabs(angle), 1.5); -- -- libinput_event_destroy(event); -- libinput_dispatch(li); -- } -- -- litest_touch_up(dev, 0); -- litest_touch_up(dev, 1); -- libinput_dispatch(li); -- event = libinput_get_event(li); -- gevent = litest_is_gesture_event(event, -- LIBINPUT_EVENT_GESTURE_PINCH_END, -- 4); -- ck_assert(!libinput_event_gesture_get_cancelled(gevent)); -- libinput_event_destroy(event); --} --END_TEST -- - START_TEST(gestures_spread) - { - struct litest_device *dev = litest_current_device(); -@@ -1282,9 +1073,7 @@ litest_setup_tests_gestures(void) - litest_add_ranged("gestures:swipe", gestures_swipe_4fg_btntool, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH, &cardinals); - litest_add_ranged("gestures:pinch", gestures_pinch, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH, &cardinals); - litest_add_ranged("gestures:pinch", gestures_pinch_3fg, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH, &cardinals); -- litest_add_ranged("gestures:pinch", gestures_pinch_3fg_btntool, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH, &cardinals); - litest_add_ranged("gestures:pinch", gestures_pinch_4fg, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH, &cardinals); -- litest_add_ranged("gestures:pinch", gestures_pinch_4fg_btntool, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH, &cardinals); - litest_add_ranged("gestures:pinch", gestures_spread, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH, &cardinals); - litest_add_ranged("gestures:pinch", gestures_pinch_vertical_positon, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH, &fingers); - --- -2.13.5 - diff --git a/libinput.spec b/libinput.spec index b95ffd6..77bc2d4 100644 --- a/libinput.spec +++ b/libinput.spec @@ -4,8 +4,8 @@ %global gitversion 58abea394 Name: libinput -Version: 1.8.1 -Release: 4%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} +Version: 1.8.2 +Release: 1%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} Summary: Input device library License: MIT @@ -18,7 +18,6 @@ Source2: commitid Source0: http://www.freedesktop.org/software/libinput/libinput-%{version}.tar.xz %endif -Patch01: 0001-gestures-don-t-try-to-pinch-for-nfingers-slots.patch Patch02: 0001-touchpad-don-t-resume-a-disabled-touchpad.patch BuildRequires: git-core @@ -106,6 +105,9 @@ git am -p1 %{patches} < /dev/null %changelog +* Thu Sep 07 2017 Peter Hutterer 1.8.2-1 +- libinput 1.8.2 + * Tue Sep 05 2017 Peter Hutterer 1.8.1-4 - Don't try pinching when the finger number exceeds available slots - Don't resume a disabled touchpad after a lid switch open (#1448962) diff --git a/sources b/sources index 88813dd..4848c70 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libinput-1.8.1.tar.xz) = 1566ccb7d1721ee2d16badc404896d31e3ac45fda71e2577db17141a507594f3827ed0a389bb537f946cb380d77feedef8e71df76ac89f8c11c44463df01ee4f +SHA512 (libinput-1.8.2.tar.xz) = 555a7680cc8aaf62c5370a865f3aff0a933d42d94a3d8861c072666b02c9e1be45ea39de9a749a9575cdfb613b6150e412e18559d94d4919f21ca4680a3c76a7