diff --git a/.gitignore b/.gitignore index c19cac5..e7994c6 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ /libinput-0.13.0.tar.xz /libinput-0.14.1.tar.xz /libinput-0.15.0.tar.xz +/libinput-0.16.0.tar.xz diff --git a/0001-touchpad-end-tap-and-drag-with-an-extra-tap.patch b/0001-touchpad-end-tap-and-drag-with-an-extra-tap.patch deleted file mode 100644 index a473cdd..0000000 --- a/0001-touchpad-end-tap-and-drag-with-an-extra-tap.patch +++ /dev/null @@ -1,1405 +0,0 @@ -From 1ab385bc83504272cf4507d72ac0d6ab448aac9c Mon Sep 17 00:00:00 2001 -From: Velimir Lisec -Date: Thu, 30 Apr 2015 00:13:51 +0200 -Subject: [PATCH libinput] touchpad: end tap-and-drag with an extra tap - -Currently for the tap-and-drag gesture to end user has to wait for a -timeout to expire. Make it possible to end the drag gesture by just tapping. - -The allowed finger sequences to start and end a drag are thus: -tap, down, .... move ...., up -tap, down, .... move ...., up, tap - -https://bugs.freedesktop.org/show_bug.cgi?id=90255 - -Signed-off-by: Velimir Lisec -Reviewed-by: Peter Hutterer - -State diagram changes and a doc change squashed in. - -Signed-off-by: Peter Hutterer ---- - doc/tapping.dox | 4 + - doc/touchpad-tap-state-machine.svg | 479 ++++++++++++++++++++----------------- - src/evdev-mt-touchpad-tap.c | 40 +++- - src/evdev-mt-touchpad.h | 1 + - 4 files changed, 304 insertions(+), 220 deletions(-) - -diff --git a/doc/tapping.dox b/doc/tapping.dox -index f603b7d..7eb81e6 100644 ---- a/doc/tapping.dox -+++ b/doc/tapping.dox -@@ -33,6 +33,10 @@ continue the dragging process, so that multiple touchpad-widths of distance - can be covered easily. If two-fingers are supported by the hardware, a - second finger can be used to drag while the first is held in-place. - -+An alternative method to end a drag process is to tap immediately after -+lifting the finger. The full sequence is thus: tap, finger down, drag, -+finger up, tap. -+ - @section tap_constraints Constraints while tapping - - A couple of constraints apply to the contact to be converted into a press, the most common ones are: -diff --git a/doc/touchpad-tap-state-machine.svg b/doc/touchpad-tap-state-machine.svg -index b168b4f..39b0b86 100644 ---- a/doc/touchpad-tap-state-machine.svg -+++ b/doc/touchpad-tap-state-machine.svg -@@ -14,93 +14,93 @@ - - - -- IDLE -+ IDLE - - - - -- TOUCH -+ TOUCH - - - - -- first -+ first - -- finger down -+ finger down - - - - - - -- finger up -+ finger up - - - - - - -- button 1 -+ button 1 - -- press -+ press - - - - -- timeout -+ timeout - - - - - - -- move > -+ move > - -- threshold -+ threshold - - - - - - -- second -+ second - -- finger down -+ finger down - - - - - - -- TOUCH_2 -+ TOUCH_2 - - - - -- second -+ second - -- finger up -+ finger up - - - - - - -- button 2 -+ button 2 - -- press -+ press - - - - -- move > -+ move > - -- threshold -+ threshold - - - - -- timeout -+ timeout - - - -@@ -109,16 +109,16 @@ - - - -- button 1 -+ button 1 - -- release -+ release - - - - -- button 2 -+ button 2 - -- release -+ release - - - -@@ -127,42 +127,42 @@ - - - -- TAPPED -+ TAPPED - - - - -- timeout -+ timeout - - - - - - -- first -+ first - -- finger down -+ finger down - - - - - - -- DRAGGING -+ DRAGGING - - - - -- first -+ first - -- finger up -+ finger up - - - - -- btn1 -+ btn1 - -- release -+ release - - - -@@ -173,81 +173,81 @@ - - - -- IDLE -+ IDLE - - - - -- third -+ third - -- finger down -+ finger down - - - - - - -- TOUCH_3 -+ TOUCH_3 - - - - - - -- button 3 -+ button 3 - -- press -+ press - - - - -- button 3 -+ button 3 - -- release -+ release - - - - - - -- move > -+ move > - -- threshold -+ threshold - - - - - - -- IDLE -+ IDLE - - - - -- timeout -+ timeout - - - - - - -- first -+ first - -- finger up -+ finger up - - - - - - -- IDLE -+ IDLE - - - - -- fourth -+ fourth - -- finger down -+ finger down - - - -@@ -256,64 +256,64 @@ - - - -- DRAGGING_OR_DOUBLETAP -+ DRAGGING_OR_DOUBLETAP - - - - - - -- timeout -+ timeout - - - - - - -- first -+ first - -- finger up -+ finger up - - - - - - -- button 1 -+ button 1 - -- release -+ release - - - - -- button 1 -+ button 1 - -- press -+ press - - - - -- btn1 -+ btn1 - -- release -+ release - - - - - - -- second -+ second - -- finger down -+ finger down - - - - - - -- move > -+ move > - -- threshold -+ threshold - - - -@@ -322,14 +322,14 @@ - - - -- HOLD -+ HOLD - - - - -- first -+ first - -- finger up -+ finger up - - - -@@ -338,9 +338,9 @@ - - - -- second -+ second - -- finger down -+ finger down - - - -@@ -351,23 +351,23 @@ - - - -- TOUCH_2_HOLD -+ TOUCH_2_HOLD - - - - -- second -+ second - -- finger up -+ finger up - - - - - - -- first -+ first - -- finger up -+ finger up - - - -@@ -378,9 +378,9 @@ - - - -- third -+ third - -- finger down -+ finger down - - - -@@ -391,21 +391,21 @@ - - - -- TOUCH_3_HOLD -+ TOUCH_3_HOLD - - - - - - -- fourth -+ fourth - -- finger down -+ finger down - - - - -- DEAD -+ DEAD - - - -@@ -416,19 +416,19 @@ - - - -- any finger up -+ any finger up - - - - -- fourth -+ fourth - -- finger up -+ finger up - - - - -- any finger up -+ any finger up - - - -@@ -437,12 +437,12 @@ - - - -- yes -+ yes - - - - -- any finger up -+ any finger up - - - -@@ -455,14 +455,14 @@ - - - -- IDLE -+ IDLE - - - - -- if finger -+ if finger - -- count == 0 -+ count == 0 - - - -@@ -473,14 +473,14 @@ - - - -- second -+ second - -- finger up -+ finger up - - - - -- DRAGGING_2 -+ DRAGGING_2 - - - -@@ -489,9 +489,9 @@ - - - -- first -+ first - -- finger up -+ finger up - - - -@@ -502,9 +502,9 @@ - - - -- second -+ second - -- finger down -+ finger down - - - -@@ -515,29 +515,29 @@ - - - -- third -+ third - -- finger down -+ finger down - - - - - - -- btn1 -+ btn1 - -- release -+ release - - - - - - -- phys -+ phys - -- button -+ button - -- press -+ press - - - -@@ -554,23 +554,23 @@ - - - -- phys -+ phys - -- button -+ button - -- press -+ press - - - -- -+ - -- -- button 1 -- -- release -+ -+ button 1 -+ -+ release - -- -- -+ -+ - - - -@@ -582,12 +582,12 @@ - - - -- DRAGGING_WAIT -+ DRAGGING_WAIT - - - - -- timeout -+ timeout - - - -@@ -598,21 +598,21 @@ - - - -- first -+ first - -- finger down -+ finger down - - - - - - -- TOUCH_TOUCH -+ TOUCH_TOUCH - - - - -- TOUCH_IDLE -+ TOUCH_IDLE - - - -@@ -625,7 +625,7 @@ - - - -- TOUCH_DEAD -+ TOUCH_DEAD - - - -@@ -640,12 +640,12 @@ - - - -- yes -+ yes - - - - -- TOUCH_DEAD -+ TOUCH_DEAD - - - -@@ -656,14 +656,14 @@ - - - -- TOUCH_IDLE -+ TOUCH_IDLE - - - - - - -- TOUCH_TOUCH -+ TOUCH_TOUCH - - - -@@ -672,44 +672,44 @@ - - - -- TOUCH_IDLE -+ TOUCH_IDLE - - - - - - -- TOUCH_IDLE -+ TOUCH_IDLE - - - - - - -- TOUCH_IDLE -+ TOUCH_IDLE - - - - - - -- TOUCH_TOUCH -+ TOUCH_TOUCH - - - - - - -- that finger -+ that finger - -- TOUCH_IDLE -+ TOUCH_IDLE - - - - - - -- TOUCH_DEAD -+ TOUCH_DEAD - - - -@@ -720,9 +720,9 @@ - - - -- that finger -+ that finger - -- TOUCH_IDLE -+ TOUCH_IDLE - - - -@@ -731,31 +731,31 @@ - - - -- no -+ no - - - - -- TOUCH_TOUCH -+ TOUCH_TOUCH - - - - - - -- TOUCH_IDLE -+ TOUCH_IDLE - - - - -- TOUCH_TOUCH -+ TOUCH_TOUCH - - - - - - -- TOUCH_DEAD -+ TOUCH_DEAD - - - -@@ -764,175 +764,171 @@ - - - -- TOUCH_IDLE -+ TOUCH_IDLE - - - -- -+ - -- -- TOUCH_TOUCH -+ -+ TOUCH_TOUCH - -- -- -- -- - - - -- TOUCH_TOUCH -+ TOUCH_TOUCH - - - - - - -- TOUCH_IDLE -+ TOUCH_IDLE - - - - - - -- TOUCH_IDLE -+ TOUCH_IDLE - - - - - - -- TOUCH_TOUCH -+ TOUCH_TOUCH - - - - - - -- TOUCH_IDLE -+ TOUCH_IDLE - - - - - - -- TOUCH_TOUCH -+ TOUCH_TOUCH - - - - - - -- that finger -+ that finger - -- TOUCH_IDLE -+ TOUCH_IDLE - - - - - - -- TOUCH_DEAD -+ TOUCH_DEAD - - - - - - -- TOUCH_DEAD -+ TOUCH_DEAD - - - - -- TOUCH_DEAD -+ TOUCH_DEAD - - - - -- TOUCH_DEAD -+ TOUCH_DEAD - -- -- -+ -+ - - - -- TOUCH_DEAD -+ TOUCH_DEAD - - - - - - -- TOUCH_DEAD -+ TOUCH_DEAD - - - - - - -- state == -+ state == - -- TOUCH_TOUCH -+ TOUCH_TOUCH - - - - -- that finger state == -+ that finger state == - -- TOUCH_TOUCH -+ TOUCH_TOUCH - - - - - - -- no -+ no - - - - -- TOUCH_DEAD -+ TOUCH_DEAD - - - - - - -- TOUCH_DEAD -+ TOUCH_DEAD - - - - -- TOUCH_DEAD -+ TOUCH_DEAD - - - - -- first -+ first - -- finger down -+ finger down - -- -+ - -- -- MULTITAP -+ -+ MULTITAP - -- -- -- -- -+ -+ -+ -+ - - - -- timeout -+ timeout - - - -- -- -+ -+ - - - -- IDLE -+ IDLE - - - -@@ -943,14 +939,14 @@ - - - -- MULTITAP_DOWN -+ MULTITAP_DOWN - - - - -- button 1 -+ button 1 - -- press -+ press - - - -@@ -959,39 +955,39 @@ - - - -- first -+ first - -- finger up -+ finger up - - - - - - -- button 1 -+ button 1 - -- release -+ release - - - - - - -- timeout -+ timeout - - - - -- second -+ second - -- finger down -+ finger down - - - - -- move > -+ move > - -- threshold -+ threshold - - - -@@ -1002,16 +998,16 @@ - - - -- button 1 -+ button 1 - -- release -+ release - - - - -- button 1 -+ button 1 - -- press -+ press - - - -@@ -1022,16 +1018,16 @@ - - - -- button 1 -+ button 1 - -- release -+ release - - - - -- button 1 -+ button 1 - -- press -+ press - - - -@@ -1042,16 +1038,16 @@ - - - -- button 1 -+ button 1 - -- release -+ release - - - - -- button 1 -+ button 1 - -- press -+ press - - - -@@ -1059,36 +1055,87 @@ - - - -- -- -+ -+ - - - -- TOUCH_TOUCH -+ TOUCH_TOUCH - - - - - - -- TOUCH_IDLE -+ TOUCH_IDLE - - - - - - -- phys -+ phys - -- button -+ button - -- press -+ press - -- -- -+ -+ - - - - -+ -+ -+ -+ DRAGGING_OR_TAP -+ -+ -+ -+ -+ first -+ -+ finger up -+ -+ -+ -+ -+ -+ -+ timeout -+ -+ -+ -+ -+ -+ -+ -+ -+ move > -+ -+ threshold -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ TOUCH_IDLE -+ -+ -+ -+ -+ -+ -+ - - -diff --git a/src/evdev-mt-touchpad-tap.c b/src/evdev-mt-touchpad-tap.c -index 61f94e5..fb8c9e4 100644 ---- a/src/evdev-mt-touchpad-tap.c -+++ b/src/evdev-mt-touchpad-tap.c -@@ -74,6 +74,7 @@ tap_state_to_str(enum tp_tap_state state) - CASE_RETURN_STRING(TAP_STATE_DRAGGING); - CASE_RETURN_STRING(TAP_STATE_DRAGGING_WAIT); - CASE_RETURN_STRING(TAP_STATE_DRAGGING_OR_DOUBLETAP); -+ CASE_RETURN_STRING(TAP_STATE_DRAGGING_OR_TAP); - CASE_RETURN_STRING(TAP_STATE_DRAGGING_2); - CASE_RETURN_STRING(TAP_STATE_MULTITAP); - CASE_RETURN_STRING(TAP_STATE_MULTITAP_DOWN); -@@ -409,16 +410,42 @@ tp_tap_dragging_wait_handle_event(struct tp_dispatch *tp, - - switch (event) { - case TAP_EVENT_TOUCH: -- tp->tap.state = TAP_STATE_DRAGGING; -+ tp->tap.state = TAP_STATE_DRAGGING_OR_TAP; -+ tp_tap_set_timer(tp, time); -+ break; -+ case TAP_EVENT_RELEASE: -+ case TAP_EVENT_MOTION: -+ break; -+ case TAP_EVENT_TIMEOUT: -+ tp->tap.state = TAP_STATE_IDLE; -+ tp_tap_notify(tp, time, 1, LIBINPUT_BUTTON_STATE_RELEASED); -+ break; -+ case TAP_EVENT_BUTTON: -+ tp->tap.state = TAP_STATE_DEAD; -+ tp_tap_notify(tp, time, 1, LIBINPUT_BUTTON_STATE_RELEASED); -+ break; -+ } -+} -+ -+static void -+tp_tap_dragging_tap_handle_event(struct tp_dispatch *tp, -+ struct tp_touch *t, -+ enum tap_event event, uint64_t time) -+{ -+ -+ switch (event) { -+ case TAP_EVENT_TOUCH: -+ tp->tap.state = TAP_STATE_DRAGGING_2; - tp_tap_clear_timer(tp); - break; - case TAP_EVENT_RELEASE: -- case TAP_EVENT_MOTION: -- break; -- case TAP_EVENT_TIMEOUT: - tp->tap.state = TAP_STATE_IDLE; - tp_tap_notify(tp, time, 1, LIBINPUT_BUTTON_STATE_RELEASED); - break; -+ case TAP_EVENT_MOTION: -+ case TAP_EVENT_TIMEOUT: -+ tp->tap.state = TAP_STATE_DRAGGING; -+ break; - case TAP_EVENT_BUTTON: - tp->tap.state = TAP_STATE_DEAD; - tp_tap_notify(tp, time, 1, LIBINPUT_BUTTON_STATE_RELEASED); -@@ -588,6 +615,9 @@ tp_tap_handle_event(struct tp_dispatch *tp, - case TAP_STATE_DRAGGING_WAIT: - tp_tap_dragging_wait_handle_event(tp, t, event, time); - break; -+ case TAP_STATE_DRAGGING_OR_TAP: -+ tp_tap_dragging_tap_handle_event(tp, t, event, time); -+ break; - case TAP_STATE_DRAGGING_2: - tp_tap_dragging2_handle_event(tp, t, event, time); - break; -@@ -692,6 +722,7 @@ tp_tap_handle_state(struct tp_dispatch *tp, uint64_t time) - case TAP_STATE_TOUCH: - case TAP_STATE_TAPPED: - case TAP_STATE_DRAGGING_OR_DOUBLETAP: -+ case TAP_STATE_DRAGGING_OR_TAP: - case TAP_STATE_TOUCH_2: - case TAP_STATE_TOUCH_3: - case TAP_STATE_MULTITAP_DOWN: -@@ -870,6 +901,7 @@ tp_tap_dragging(struct tp_dispatch *tp) - case TAP_STATE_DRAGGING: - case TAP_STATE_DRAGGING_2: - case TAP_STATE_DRAGGING_WAIT: -+ case TAP_STATE_DRAGGING_OR_TAP: - return true; - default: - return false; -diff --git a/src/evdev-mt-touchpad.h b/src/evdev-mt-touchpad.h -index 3711375..f602359 100644 ---- a/src/evdev-mt-touchpad.h -+++ b/src/evdev-mt-touchpad.h -@@ -94,6 +94,7 @@ enum tp_tap_state { - TAP_STATE_TOUCH_3, - TAP_STATE_TOUCH_3_HOLD, - TAP_STATE_DRAGGING_OR_DOUBLETAP, -+ TAP_STATE_DRAGGING_OR_TAP, - TAP_STATE_DRAGGING, - TAP_STATE_DRAGGING_WAIT, - TAP_STATE_DRAGGING_2, --- -2.4.1 - diff --git a/0001-touchpad-move-disable-while-typing-into-its-own-stru.patch b/0001-touchpad-move-disable-while-typing-into-its-own-stru.patch deleted file mode 100644 index b2ce138..0000000 --- a/0001-touchpad-move-disable-while-typing-into-its-own-stru.patch +++ /dev/null @@ -1,148 +0,0 @@ -From 09c597a3a782d1eb82f5e911f91114eb7ef44002 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Mon, 25 May 2015 10:07:51 +1000 -Subject: [PATCH libinput 01/10] touchpad: move disable-while-typing into its - own struct - -Signed-off-by: Peter Hutterer -Reviewed-by: Hans de Goede -Tested-by: Benjamin Tissoires ---- - src/evdev-mt-touchpad.c | 34 +++++++++++++++++----------------- - src/evdev-mt-touchpad.h | 4 +++- - 2 files changed, 20 insertions(+), 18 deletions(-) - -diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c -index 821e645..89d24f3 100644 ---- a/src/evdev-mt-touchpad.c -+++ b/src/evdev-mt-touchpad.c -@@ -486,7 +486,7 @@ tp_palm_detect(struct tp_dispatch *tp, struct tp_touch *t, uint64_t time) - struct device_float_coords delta; - int dirs; - -- if (tp->sendevents.keyboard_active && -+ if (tp->dwt.keyboard_active && - t->state == TOUCH_BEGIN) { - t->palm.state = PALM_TYPING; - t->palm.time = time; -@@ -682,7 +682,7 @@ tp_post_events(struct tp_dispatch *tp, uint64_t time) - - if (filter_motion || - tp->sendevents.trackpoint_active || -- tp->sendevents.keyboard_active) { -+ tp->dwt.keyboard_active) { - tp_edge_scroll_stop_events(tp, time); - tp_gesture_stop(tp, time); - return; -@@ -732,15 +732,15 @@ static void - tp_remove_sendevents(struct tp_dispatch *tp) - { - libinput_timer_cancel(&tp->sendevents.trackpoint_timer); -- libinput_timer_cancel(&tp->sendevents.keyboard_timer); -+ libinput_timer_cancel(&tp->dwt.keyboard_timer); - - if (tp->buttons.trackpoint) - libinput_device_remove_event_listener( - &tp->sendevents.trackpoint_listener); - -- if (tp->sendevents.keyboard) -+ if (tp->dwt.keyboard) - libinput_device_remove_event_listener( -- &tp->sendevents.keyboard_listener); -+ &tp->dwt.keyboard_listener); - } - - static void -@@ -868,7 +868,7 @@ tp_keyboard_timeout(uint64_t now, void *data) - struct tp_dispatch *tp = data; - - tp_tap_resume(tp, now); -- tp->sendevents.keyboard_active = false; -+ tp->dwt.keyboard_active = false; - } - - static void -@@ -903,17 +903,17 @@ tp_keyboard_event(uint64_t time, struct libinput_event *event, void *data) - break; - } - -- if (!tp->sendevents.keyboard_active) { -+ if (!tp->dwt.keyboard_active) { - tp_edge_scroll_stop_events(tp, time); - tp_gesture_stop(tp, time); - tp_tap_suspend(tp, time); -- tp->sendevents.keyboard_active = true; -+ tp->dwt.keyboard_active = true; - timeout = DEFAULT_KEYBOARD_ACTIVITY_TIMEOUT_1; - } else { - timeout = DEFAULT_KEYBOARD_ACTIVITY_TIMEOUT_2; - } - -- libinput_timer_set(&tp->sendevents.keyboard_timer, -+ libinput_timer_set(&tp->dwt.keyboard_timer, - time + timeout); - } - -@@ -945,12 +945,12 @@ tp_device_added(struct evdev_device *device, - kbd_is_internal = bus_tp != BUS_BLUETOOTH && - bus_kbd == bus_tp; - if (tp_is_internal && kbd_is_internal && -- tp->sendevents.keyboard == NULL) { -+ tp->dwt.keyboard == NULL) { - libinput_device_add_event_listener(&added_device->base, -- &tp->sendevents.keyboard_listener, -+ &tp->dwt.keyboard_listener, - tp_keyboard_event, tp); -- tp->sendevents.keyboard = added_device; -- tp->sendevents.keyboard_active = false; -+ tp->dwt.keyboard = added_device; -+ tp->dwt.keyboard_active = false; - } - - if (tp->sendevents.current_mode != -@@ -979,10 +979,10 @@ tp_device_removed(struct evdev_device *device, - tp->buttons.trackpoint = NULL; - } - -- if (removed_device == tp->sendevents.keyboard) { -+ if (removed_device == tp->dwt.keyboard) { - libinput_device_remove_event_listener( -- &tp->sendevents.keyboard_listener); -- tp->sendevents.keyboard = NULL; -+ &tp->dwt.keyboard_listener); -+ tp->dwt.keyboard = NULL; - } - - if (tp->sendevents.current_mode != -@@ -1261,7 +1261,7 @@ tp_init_sendevents(struct tp_dispatch *tp, - tp->device->base.seat->libinput, - tp_trackpoint_timeout, tp); - -- libinput_timer_init(&tp->sendevents.keyboard_timer, -+ libinput_timer_init(&tp->dwt.keyboard_timer, - tp->device->base.seat->libinput, - tp_keyboard_timeout, tp); - return 0; -diff --git a/src/evdev-mt-touchpad.h b/src/evdev-mt-touchpad.h -index 1413945..70b35f4 100644 ---- a/src/evdev-mt-touchpad.h -+++ b/src/evdev-mt-touchpad.h -@@ -279,12 +279,14 @@ struct tp_dispatch { - bool trackpoint_active; - struct libinput_event_listener trackpoint_listener; - struct libinput_timer trackpoint_timer; -+ } sendevents; - -+ struct { - bool keyboard_active; - struct libinput_event_listener keyboard_listener; - struct libinput_timer keyboard_timer; - struct evdev_device *keyboard; -- } sendevents; -+ } dwt; - }; - - #define tp_for_each_touch(_tp, _t) \ --- -2.4.1 - diff --git a/0001-touchpad-switch-from-is_palm-to-an-enum.patch b/0001-touchpad-switch-from-is_palm-to-an-enum.patch deleted file mode 100644 index ca14e5a..0000000 --- a/0001-touchpad-switch-from-is_palm-to-an-enum.patch +++ /dev/null @@ -1,91 +0,0 @@ -From d288eb0a63793ebb64de041960336d6fb57060b0 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Mon, 20 Apr 2015 16:09:31 +1000 -Subject: [PATCH libinput 1/3] touchpad: switch from is_palm to an enum - -Preparation to add different palm detection types. Not all of them need to be -un-done when leaving the edge area so a boolean is not enough. - -Signed-off-by: Peter Hutterer -Reviewed-by: Hans de Goede ---- - src/evdev-mt-touchpad.c | 10 +++++----- - src/evdev-mt-touchpad.h | 7 ++++++- - 2 files changed, 11 insertions(+), 6 deletions(-) - -diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c -index 79177fb..d8b44fa 100644 ---- a/src/evdev-mt-touchpad.c -+++ b/src/evdev-mt-touchpad.c -@@ -231,7 +231,7 @@ tp_end_touch(struct tp_dispatch *tp, struct tp_touch *t, uint64_t time) - } - - t->dirty = true; -- t->palm.is_palm = false; -+ t->palm.state = PALM_NONE; - t->state = TOUCH_END; - t->pinned.is_pinned = false; - t->millis = time; -@@ -455,7 +455,7 @@ int - tp_touch_active(struct tp_dispatch *tp, struct tp_touch *t) - { - return (t->state == TOUCH_BEGIN || t->state == TOUCH_UPDATE) && -- !t->palm.is_palm && -+ t->palm.state == PALM_NONE && - !t->pinned.is_pinned && - tp_button_touch_active(tp, t) && - tp_edge_scroll_touch_active(tp, t); -@@ -491,14 +491,14 @@ tp_palm_detect(struct tp_dispatch *tp, struct tp_touch *t, uint64_t time) - we move out of the palm edge zone within the timeout, provided - the direction is within 45 degrees of the horizontal. - */ -- if (t->palm.is_palm) { -+ if (t->palm.state == PALM_EDGE) { - if (time < t->palm.time + PALM_TIMEOUT && - (t->point.x > tp->palm.left_edge && t->point.x < tp->palm.right_edge)) { - delta = device_delta(t->point, t->palm.first); - dirs = normalized_get_direction( - tp_normalize_delta(tp, delta)); - if ((dirs & DIRECTIONS) && !(dirs & ~DIRECTIONS)) { -- t->palm.is_palm = false; -+ t->palm.state = PALM_NONE; - } - } - return; -@@ -517,7 +517,7 @@ tp_palm_detect(struct tp_dispatch *tp, struct tp_touch *t, uint64_t time) - tp_button_is_inside_softbutton_area(tp, t)) - return; - -- t->palm.is_palm = true; -+ t->palm.state = PALM_EDGE; - t->palm.time = time; - t->palm.first = t->point; - } -diff --git a/src/evdev-mt-touchpad.h b/src/evdev-mt-touchpad.h -index f602359..ba65e41 100644 ---- a/src/evdev-mt-touchpad.h -+++ b/src/evdev-mt-touchpad.h -@@ -61,6 +61,11 @@ enum touch_state { - TOUCH_END - }; - -+enum touch_palm_state { -+ PALM_NONE = 0, -+ PALM_EDGE, -+}; -+ - enum button_event { - BUTTON_EVENT_IN_BOTTOM_R = 30, - BUTTON_EVENT_IN_BOTTOM_L, -@@ -171,7 +176,7 @@ struct tp_touch { - } scroll; - - struct { -- bool is_palm; -+ enum touch_palm_state state; - struct device_coords first; /* first coordinates if is_palm == true */ - uint32_t time; /* first timestamp if is_palm == true */ - } palm; --- -2.3.5 - diff --git a/0002-touchpad-add-timeout-based-disable-while-typing.patch b/0002-touchpad-add-timeout-based-disable-while-typing.patch deleted file mode 100644 index 6e7208d..0000000 --- a/0002-touchpad-add-timeout-based-disable-while-typing.patch +++ /dev/null @@ -1,209 +0,0 @@ -From d02b670e3796c10fa75b94165886901a0a0c41f4 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Mon, 20 Apr 2015 15:51:20 +1000 -Subject: [PATCH libinput 2/3] touchpad: add timeout-based disable-while-typing - -On some touchpads, typing triggers touches in areas of the touchpad that -cannot easily be distinguished from other fingers. Pressure information is -useless too, so we have to go back to a timeout-based handling of touch data. - -If we see non-modifier key events, disable the touchpad for a timeout and set -any touches starting during that timeout as palm. - -Signed-off-by: Peter Hutterer -Reviewed-by: Hans de Goede ---- - src/evdev-mt-touchpad.c | 90 +++++++++++++++++++++++++++++++++++++++++++++++-- - src/evdev-mt-touchpad.h | 7 ++++ - 2 files changed, 94 insertions(+), 3 deletions(-) - -diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c -index d8b44fa..32d8e25 100644 ---- a/src/evdev-mt-touchpad.c -+++ b/src/evdev-mt-touchpad.c -@@ -34,6 +34,7 @@ - #define DEFAULT_ACCEL_NUMERATOR 3000.0 - #define DEFAULT_HYSTERESIS_MARGIN_DENOMINATOR 700.0 - #define DEFAULT_TRACKPOINT_ACTIVITY_TIMEOUT 500 /* ms */ -+#define DEFAULT_KEYBOARD_ACTIVITY_TIMEOUT 500 /* ms */ - #define FAKE_FINGER_OVERFLOW (1 << 7) - - static inline int -@@ -487,6 +488,14 @@ tp_palm_detect(struct tp_dispatch *tp, struct tp_touch *t, uint64_t time) - struct device_float_coords delta; - int dirs; - -+ if (tp->sendevents.keyboard_active && -+ t->state == TOUCH_BEGIN) { -+ t->palm.state = PALM_TYPING; -+ t->palm.time = time; -+ t->palm.first = t->point; -+ return; -+ } -+ - /* If labelled a touch as palm, we unlabel as palm when - we move out of the palm edge zone within the timeout, provided - the direction is within 45 degrees of the horizontal. -@@ -705,7 +714,9 @@ tp_post_events(struct tp_dispatch *tp, uint64_t time) - filter_motion |= tp_tap_handle_state(tp, time); - filter_motion |= tp_post_button_events(tp, time); - -- if (filter_motion || tp->sendevents.trackpoint_active) { -+ if (filter_motion || -+ tp->sendevents.trackpoint_active || -+ tp->sendevents.keyboard_active) { - tp_edge_scroll_stop_events(tp, time); - tp_gesture_stop(tp, time); - return; -@@ -755,10 +766,15 @@ static void - tp_remove_sendevents(struct tp_dispatch *tp) - { - libinput_timer_cancel(&tp->sendevents.trackpoint_timer); -+ libinput_timer_cancel(&tp->sendevents.keyboard_timer); - - if (tp->buttons.trackpoint) - libinput_device_remove_event_listener( - &tp->sendevents.trackpoint_listener); -+ -+ if (tp->sendevents.keyboard) -+ libinput_device_remove_event_listener( -+ &tp->sendevents.keyboard_listener); - } - - static void -@@ -881,13 +897,59 @@ tp_trackpoint_event(uint64_t time, struct libinput_event *event, void *data) - } - - static void -+tp_keyboard_timeout(uint64_t now, void *data) -+{ -+ struct tp_dispatch *tp = data; -+ -+ tp_tap_resume(tp, now); -+ tp->sendevents.keyboard_active = false; -+} -+ -+static void -+tp_keyboard_event(uint64_t time, struct libinput_event *event, void *data) -+{ -+ struct tp_dispatch *tp = data; -+ struct libinput_event_keyboard *kbdev; -+ -+ if (event->type != LIBINPUT_EVENT_KEYBOARD_KEY) -+ return; -+ -+ kbdev = libinput_event_get_keyboard_event(event); -+ /* modifier keys don't trigger disable-while-typing so things like -+ * ctrl+zoom or ctrl+click are possible */ -+ switch (libinput_event_keyboard_get_key(kbdev)) { -+ case KEY_LEFTCTRL: -+ case KEY_RIGHTCTRL: -+ case KEY_LEFTALT: -+ case KEY_RIGHTALT: -+ case KEY_LEFTSHIFT: -+ case KEY_RIGHTSHIFT: -+ case KEY_FN: -+ return; -+ default: -+ break; -+ } -+ -+ if (!tp->sendevents.keyboard_active) { -+ tp_edge_scroll_stop_events(tp, time); -+ tp_gesture_stop(tp, time); -+ tp_tap_suspend(tp, time); -+ tp->sendevents.keyboard_active = true; -+ } -+ -+ libinput_timer_set(&tp->sendevents.keyboard_timer, -+ time + DEFAULT_KEYBOARD_ACTIVITY_TIMEOUT); -+} -+ -+static void - tp_device_added(struct evdev_device *device, - struct evdev_device *added_device) - { - struct tp_dispatch *tp = (struct tp_dispatch*)device->dispatch; - unsigned int bus_tp = libevdev_get_id_bustype(device->evdev), -- bus_trp = libevdev_get_id_bustype(added_device->evdev); -- bool tp_is_internal, trp_is_internal; -+ bus_trp = libevdev_get_id_bustype(added_device->evdev), -+ bus_kbd = libevdev_get_id_bustype(added_device->evdev); -+ bool tp_is_internal, trp_is_internal, kbd_is_internal; - - tp_is_internal = bus_tp != BUS_USB && bus_tp != BUS_BLUETOOTH; - trp_is_internal = bus_trp != BUS_USB && bus_trp != BUS_BLUETOOTH; -@@ -903,6 +965,18 @@ tp_device_added(struct evdev_device *device, - tp_trackpoint_event, tp); - } - -+ /* FIXME: detect external keyboard better */ -+ kbd_is_internal = bus_tp != BUS_BLUETOOTH && -+ bus_kbd == bus_tp; -+ if (tp_is_internal && kbd_is_internal && -+ tp->sendevents.keyboard == NULL) { -+ libinput_device_add_event_listener(&added_device->base, -+ &tp->sendevents.keyboard_listener, -+ tp_keyboard_event, tp); -+ tp->sendevents.keyboard = added_device; -+ tp->sendevents.keyboard_active = false; -+ } -+ - if (tp->sendevents.current_mode != - LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE) - return; -@@ -929,6 +1003,12 @@ tp_device_removed(struct evdev_device *device, - tp->buttons.trackpoint = NULL; - } - -+ if (removed_device == tp->sendevents.keyboard) { -+ libinput_device_remove_event_listener( -+ &tp->sendevents.keyboard_listener); -+ tp->sendevents.keyboard = NULL; -+ } -+ - if (tp->sendevents.current_mode != - LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE) - return; -@@ -1204,6 +1284,10 @@ tp_init_sendevents(struct tp_dispatch *tp, - libinput_timer_init(&tp->sendevents.trackpoint_timer, - tp->device->base.seat->libinput, - tp_trackpoint_timeout, tp); -+ -+ libinput_timer_init(&tp->sendevents.keyboard_timer, -+ tp->device->base.seat->libinput, -+ tp_keyboard_timeout, tp); - return 0; - } - -diff --git a/src/evdev-mt-touchpad.h b/src/evdev-mt-touchpad.h -index ba65e41..3d51a39 100644 ---- a/src/evdev-mt-touchpad.h -+++ b/src/evdev-mt-touchpad.h -@@ -64,6 +64,7 @@ enum touch_state { - enum touch_palm_state { - PALM_NONE = 0, - PALM_EDGE, -+ PALM_TYPING, - }; - - enum button_event { -@@ -277,9 +278,15 @@ struct tp_dispatch { - struct { - struct libinput_device_config_send_events config; - enum libinput_config_send_events_mode current_mode; -+ - bool trackpoint_active; - struct libinput_event_listener trackpoint_listener; - struct libinput_timer trackpoint_timer; -+ -+ bool keyboard_active; -+ struct libinput_event_listener keyboard_listener; -+ struct libinput_timer keyboard_timer; -+ struct evdev_device *keyboard; - } sendevents; - }; - --- -2.3.5 - diff --git a/0002-touchpad-extend-the-key-blacklist-for-disable-while-.patch b/0002-touchpad-extend-the-key-blacklist-for-disable-while-.patch deleted file mode 100644 index c8d983d..0000000 --- a/0002-touchpad-extend-the-key-blacklist-for-disable-while-.patch +++ /dev/null @@ -1,84 +0,0 @@ -From 640c17cb8102a1833e0366eaf3f7bd5325147741 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Mon, 25 May 2015 08:48:25 +1000 -Subject: [PATCH libinput 02/10] touchpad: extend the key blacklist for - disable-while-typing - -Alt-tab should not trigger the disable-while-typing timeout, likewise with the -F-keys, multimedia keys, the windows and menu key, etc. - -https://bugs.freedesktop.org/show_bug.cgi?id=90613 - -Signed-off-by: Peter Hutterer -Reviewed-by: Hans de Goede -Tested-by: Benjamin Tissoires ---- - src/evdev-mt-touchpad.c | 45 +++++++++++++++++++++++++++++++++------------ - 1 file changed, 33 insertions(+), 12 deletions(-) - -diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c -index 89d24f3..26edcb4 100644 ---- a/src/evdev-mt-touchpad.c -+++ b/src/evdev-mt-touchpad.c -@@ -871,6 +871,37 @@ tp_keyboard_timeout(uint64_t now, void *data) - tp->dwt.keyboard_active = false; - } - -+static inline bool -+tp_key_ignore_for_dwt(unsigned int keycode) -+{ -+ switch (keycode) { -+ /* Ignore modifiers to be responsive to ctrl-click, alt-tab, etc. */ -+ case KEY_LEFTCTRL: -+ case KEY_RIGHTCTRL: -+ case KEY_LEFTALT: -+ case KEY_RIGHTALT: -+ case KEY_LEFTSHIFT: -+ case KEY_RIGHTSHIFT: -+ case KEY_FN: -+ case KEY_CAPSLOCK: -+ case KEY_TAB: -+ case KEY_COMPOSE: -+ case KEY_RIGHTMETA: -+ case KEY_LEFTMETA: -+ return true; -+ default: -+ break; -+ } -+ -+ /* Ignore keys not part of the "typewriter set", i.e. F-keys, -+ * multimedia keys, numpad, etc. -+ */ -+ if (keycode >= KEY_F1) -+ return true; -+ -+ return false; -+} -+ - static void - tp_keyboard_event(uint64_t time, struct libinput_event *event, void *data) - { -@@ -890,18 +921,8 @@ tp_keyboard_event(uint64_t time, struct libinput_event *event, void *data) - - /* modifier keys don't trigger disable-while-typing so things like - * ctrl+zoom or ctrl+click are possible */ -- switch (libinput_event_keyboard_get_key(kbdev)) { -- case KEY_LEFTCTRL: -- case KEY_RIGHTCTRL: -- case KEY_LEFTALT: -- case KEY_RIGHTALT: -- case KEY_LEFTSHIFT: -- case KEY_RIGHTSHIFT: -- case KEY_FN: -- return; -- default: -- break; -- } -+ if (tp_key_ignore_for_dwt(libinput_event_keyboard_get_key(kbdev))) -+ return; - - if (!tp->dwt.keyboard_active) { - tp_edge_scroll_stop_events(tp, time); --- -2.4.1 - diff --git a/0003-touchpad-add-helper-function-to-get-from-tp-to-the-l.patch b/0003-touchpad-add-helper-function-to-get-from-tp-to-the-l.patch deleted file mode 100644 index e8c44b0..0000000 --- a/0003-touchpad-add-helper-function-to-get-from-tp-to-the-l.patch +++ /dev/null @@ -1,220 +0,0 @@ -From c007b9aa435bb04066874fada4e5ef35147a3f4d Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Fri, 22 May 2015 15:16:31 +1000 -Subject: [PATCH libinput 03/10] touchpad: add helper function to get from tp - to the libinput context - -Signed-off-by: Peter Hutterer -Reviewed-by: Hans de Goede -Tested-by: Benjamin Tissoires ---- - src/evdev-mt-touchpad-buttons.c | 8 ++++---- - src/evdev-mt-touchpad-edge-scroll.c | 12 ++++++------ - src/evdev-mt-touchpad-tap.c | 10 +++++----- - src/evdev-mt-touchpad.c | 8 ++++---- - src/evdev-mt-touchpad.h | 6 ++++++ - 5 files changed, 25 insertions(+), 19 deletions(-) - -diff --git a/src/evdev-mt-touchpad-buttons.c b/src/evdev-mt-touchpad-buttons.c -index d6acbf0..2f24ee6 100644 ---- a/src/evdev-mt-touchpad-buttons.c -+++ b/src/evdev-mt-touchpad-buttons.c -@@ -392,7 +392,7 @@ tp_button_handle_event(struct tp_dispatch *tp, - enum button_event event, - uint64_t time) - { -- struct libinput *libinput = tp->device->base.seat->libinput; -+ struct libinput *libinput = tp_libinput_context(tp); - enum button_state current = t->button.state; - - switch(t->button.state) { -@@ -478,7 +478,7 @@ tp_process_button(struct tp_dispatch *tp, - const struct input_event *e, - uint64_t time) - { -- struct libinput *libinput = tp->device->base.seat->libinput; -+ struct libinput *libinput = tp_libinput_context(tp); - uint32_t mask = 1 << (e->code - BTN_LEFT); - - /* Ignore other buttons on clickpads */ -@@ -680,7 +680,7 @@ int - tp_init_buttons(struct tp_dispatch *tp, - struct evdev_device *device) - { -- struct libinput *libinput = tp->device->base.seat->libinput; -+ struct libinput *libinput = tp_libinput_context(tp); - struct tp_touch *t; - int width, height; - double diagonal; -@@ -731,7 +731,7 @@ tp_init_buttons(struct tp_dispatch *tp, - tp_for_each_touch(tp, t) { - t->button.state = BUTTON_STATE_NONE; - libinput_timer_init(&t->button.timer, -- tp->device->base.seat->libinput, -+ tp_libinput_context(tp), - tp_button_handle_timeout, t); - } - -diff --git a/src/evdev-mt-touchpad-edge-scroll.c b/src/evdev-mt-touchpad-edge-scroll.c -index 369fded..9bf3f0c 100644 ---- a/src/evdev-mt-touchpad-edge-scroll.c -+++ b/src/evdev-mt-touchpad-edge-scroll.c -@@ -121,7 +121,7 @@ tp_edge_scroll_handle_none(struct tp_dispatch *tp, - struct tp_touch *t, - enum scroll_event event) - { -- struct libinput *libinput = tp->device->base.seat->libinput; -+ struct libinput *libinput = tp_libinput_context(tp); - - switch (event) { - case SCROLL_EVENT_TOUCH: -@@ -149,7 +149,7 @@ tp_edge_scroll_handle_edge_new(struct tp_dispatch *tp, - struct tp_touch *t, - enum scroll_event event) - { -- struct libinput *libinput = tp->device->base.seat->libinput; -+ struct libinput *libinput = tp_libinput_context(tp); - - switch (event) { - case SCROLL_EVENT_TOUCH: -@@ -178,7 +178,7 @@ tp_edge_scroll_handle_edge(struct tp_dispatch *tp, - struct tp_touch *t, - enum scroll_event event) - { -- struct libinput *libinput = tp->device->base.seat->libinput; -+ struct libinput *libinput = tp_libinput_context(tp); - - switch (event) { - case SCROLL_EVENT_TOUCH: -@@ -209,7 +209,7 @@ tp_edge_scroll_handle_area(struct tp_dispatch *tp, - struct tp_touch *t, - enum scroll_event event) - { -- struct libinput *libinput = tp->device->base.seat->libinput; -+ struct libinput *libinput = tp_libinput_context(tp); - - switch (event) { - case SCROLL_EVENT_TOUCH: -@@ -232,7 +232,7 @@ tp_edge_scroll_handle_event(struct tp_dispatch *tp, - struct tp_touch *t, - enum scroll_event event) - { -- struct libinput *libinput = tp->device->base.seat->libinput; -+ struct libinput *libinput = tp_libinput_context(tp); - enum tp_edge_scroll_touch_state current = t->scroll.edge_state; - - switch (current) { -@@ -301,7 +301,7 @@ tp_edge_scroll_init(struct tp_dispatch *tp, struct evdev_device *device) - tp_for_each_touch(tp, t) { - t->scroll.direction = -1; - libinput_timer_init(&t->scroll.timer, -- device->base.seat->libinput, -+ tp_libinput_context(tp), - tp_edge_scroll_handle_timeout, t); - } - -diff --git a/src/evdev-mt-touchpad-tap.c b/src/evdev-mt-touchpad-tap.c -index 61f94e5..21b2e29 100644 ---- a/src/evdev-mt-touchpad-tap.c -+++ b/src/evdev-mt-touchpad-tap.c -@@ -146,7 +146,7 @@ tp_tap_idle_handle_event(struct tp_dispatch *tp, - struct tp_touch *t, - enum tap_event event, uint64_t time) - { -- struct libinput *libinput = tp->device->base.seat->libinput; -+ struct libinput *libinput = tp_libinput_context(tp); - - switch (event) { - case TAP_EVENT_TOUCH: -@@ -222,7 +222,7 @@ tp_tap_tapped_handle_event(struct tp_dispatch *tp, - struct tp_touch *t, - enum tap_event event, uint64_t time) - { -- struct libinput *libinput = tp->device->base.seat->libinput; -+ struct libinput *libinput = tp_libinput_context(tp); - - switch (event) { - case TAP_EVENT_MOTION: -@@ -456,7 +456,7 @@ tp_tap_multitap_handle_event(struct tp_dispatch *tp, - struct tp_touch *t, - enum tap_event event, uint64_t time) - { -- struct libinput *libinput = tp->device->base.seat->libinput; -+ struct libinput *libinput = tp_libinput_context(tp); - - switch (event) { - case TAP_EVENT_RELEASE: -@@ -549,7 +549,7 @@ tp_tap_handle_event(struct tp_dispatch *tp, - enum tap_event event, - uint64_t time) - { -- struct libinput *libinput = tp->device->base.seat->libinput; -+ struct libinput *libinput = tp_libinput_context(tp); - enum tp_tap_state current; - - current = tp->tap.state; -@@ -826,7 +826,7 @@ tp_init_tap(struct tp_dispatch *tp) - tp->tap.enabled = tp_tap_default(tp->device); - - libinput_timer_init(&tp->tap.timer, -- tp->device->base.seat->libinput, -+ tp_libinput_context(tp), - tp_tap_handle_timeout, tp); - - return 0; -diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c -index 26edcb4..6c0daf0 100644 ---- a/src/evdev-mt-touchpad.c -+++ b/src/evdev-mt-touchpad.c -@@ -775,7 +775,7 @@ tp_release_fake_touches(struct tp_dispatch *tp) - static void - tp_clear_state(struct tp_dispatch *tp) - { -- uint64_t now = libinput_now(tp->device->base.seat->libinput); -+ uint64_t now = libinput_now(tp_libinput_context(tp)); - struct tp_touch *t; - - /* Unroll the touchpad state. -@@ -1178,7 +1178,7 @@ tp_scroll_config_scroll_method_set_method(struct libinput_device *device, - { - struct evdev_device *evdev = (struct evdev_device*)device; - struct tp_dispatch *tp = (struct tp_dispatch*)evdev->dispatch; -- uint64_t time = libinput_now(device->seat->libinput); -+ uint64_t time = libinput_now(tp_libinput_context(tp)); - - if (method == tp->scroll.method) - return LIBINPUT_CONFIG_STATUS_SUCCESS; -@@ -1279,11 +1279,11 @@ tp_init_sendevents(struct tp_dispatch *tp, - struct evdev_device *device) - { - libinput_timer_init(&tp->sendevents.trackpoint_timer, -- tp->device->base.seat->libinput, -+ tp_libinput_context(tp), - tp_trackpoint_timeout, tp); - - libinput_timer_init(&tp->dwt.keyboard_timer, -- tp->device->base.seat->libinput, -+ tp_libinput_context(tp), - tp_keyboard_timeout, tp); - return 0; - } -diff --git a/src/evdev-mt-touchpad.h b/src/evdev-mt-touchpad.h -index 70b35f4..f8c837d 100644 ---- a/src/evdev-mt-touchpad.h -+++ b/src/evdev-mt-touchpad.h -@@ -292,6 +292,12 @@ struct tp_dispatch { - #define tp_for_each_touch(_tp, _t) \ - for (unsigned int _i = 0; _i < (_tp)->ntouches && (_t = &(_tp)->touches[_i]); _i++) - -+static inline struct libinput* -+tp_libinput_context(struct tp_dispatch *tp) -+{ -+ return tp->device->base.seat->libinput; -+} -+ - static inline struct normalized_coords - tp_normalize_delta(struct tp_dispatch *tp, struct device_float_coords delta) - { --- -2.4.1 - diff --git a/0003-touchpad-use-a-two-stage-timeout-for-disable-while-t.patch b/0003-touchpad-use-a-two-stage-timeout-for-disable-while-t.patch deleted file mode 100644 index de0aa6f..0000000 --- a/0003-touchpad-use-a-two-stage-timeout-for-disable-while-t.patch +++ /dev/null @@ -1,71 +0,0 @@ -From c2f8b508b9fc661967516ca07d2100ca8749c101 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Mon, 20 Apr 2015 16:20:00 +1000 -Subject: [PATCH libinput 3/3] touchpad: use a two-stage timeout for - disable-while-typing - -Hitting a single key triggers a short timeout, just enough to cover the time -to the next key event. Hitting more than one key triggers the longer timeout. - -This should improve responsiveness after single key events when the touchpad is -still the main interaction mode and a key needs to be pressed to advance in -the UI. When typing the hands require physical movement to get back to the -touchpad anyway so a longer timeout is acceptable and more reliable. - -Signed-off-by: Peter Hutterer -Reviewed-by: Hans de Goede ---- - src/evdev-mt-touchpad.c | 15 +++++++++++++-- - 1 file changed, 13 insertions(+), 2 deletions(-) - -diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c -index 32d8e25..3ebb559 100644 ---- a/src/evdev-mt-touchpad.c -+++ b/src/evdev-mt-touchpad.c -@@ -34,7 +34,8 @@ - #define DEFAULT_ACCEL_NUMERATOR 3000.0 - #define DEFAULT_HYSTERESIS_MARGIN_DENOMINATOR 700.0 - #define DEFAULT_TRACKPOINT_ACTIVITY_TIMEOUT 500 /* ms */ --#define DEFAULT_KEYBOARD_ACTIVITY_TIMEOUT 500 /* ms */ -+#define DEFAULT_KEYBOARD_ACTIVITY_TIMEOUT_1 200 /* ms */ -+#define DEFAULT_KEYBOARD_ACTIVITY_TIMEOUT_2 500 /* ms */ - #define FAKE_FINGER_OVERFLOW (1 << 7) - - static inline int -@@ -910,11 +911,18 @@ tp_keyboard_event(uint64_t time, struct libinput_event *event, void *data) - { - struct tp_dispatch *tp = data; - struct libinput_event_keyboard *kbdev; -+ unsigned int timeout; - - if (event->type != LIBINPUT_EVENT_KEYBOARD_KEY) - return; - - kbdev = libinput_event_get_keyboard_event(event); -+ -+ /* Only trigger the timer on key down. */ -+ if (libinput_event_keyboard_get_key_state(kbdev) != -+ LIBINPUT_KEY_STATE_PRESSED) -+ return; -+ - /* modifier keys don't trigger disable-while-typing so things like - * ctrl+zoom or ctrl+click are possible */ - switch (libinput_event_keyboard_get_key(kbdev)) { -@@ -935,10 +943,13 @@ tp_keyboard_event(uint64_t time, struct libinput_event *event, void *data) - tp_gesture_stop(tp, time); - tp_tap_suspend(tp, time); - tp->sendevents.keyboard_active = true; -+ timeout = DEFAULT_KEYBOARD_ACTIVITY_TIMEOUT_1; -+ } else { -+ timeout = DEFAULT_KEYBOARD_ACTIVITY_TIMEOUT_2; - } - - libinput_timer_set(&tp->sendevents.keyboard_timer, -- time + DEFAULT_KEYBOARD_ACTIVITY_TIMEOUT); -+ time + timeout); - } - - static void --- -2.3.5 - diff --git a/0004-touchpad-only-check-keyboards-for-disable-while-typi.patch b/0004-touchpad-only-check-keyboards-for-disable-while-typi.patch deleted file mode 100644 index 8871177..0000000 --- a/0004-touchpad-only-check-keyboards-for-disable-while-typi.patch +++ /dev/null @@ -1,104 +0,0 @@ -From 5a18344bbc0a47f13752d8e39a22450f89624980 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Fri, 22 May 2015 15:51:18 +1000 -Subject: [PATCH libinput 04/10] touchpad: only check keyboards for - disable-while-typing - -The keyboard test is a simple one, if we have the first row of alphabetic -keys, we assume it's a full keyboard. - -Signed-off-by: Peter Hutterer -Reviewed-by: Hans de Goede -Tested-by: Benjamin Tissoires ---- - src/evdev-mt-touchpad.c | 22 ++++++++++++---------- - src/evdev.c | 20 ++++++++++++++++++++ - src/evdev.h | 1 + - 3 files changed, 33 insertions(+), 10 deletions(-) - -diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c -index 6c0daf0..5a05129 100644 ---- a/src/evdev-mt-touchpad.c -+++ b/src/evdev-mt-touchpad.c -@@ -962,16 +962,18 @@ tp_device_added(struct evdev_device *device, - tp_trackpoint_event, tp); - } - -- /* FIXME: detect external keyboard better */ -- kbd_is_internal = bus_tp != BUS_BLUETOOTH && -- bus_kbd == bus_tp; -- if (tp_is_internal && kbd_is_internal && -- tp->dwt.keyboard == NULL) { -- libinput_device_add_event_listener(&added_device->base, -- &tp->dwt.keyboard_listener, -- tp_keyboard_event, tp); -- tp->dwt.keyboard = added_device; -- tp->dwt.keyboard_active = false; -+ if (added_device->tags & EVDEV_TAG_KEYBOARD) { -+ /* FIXME: detect external keyboard better */ -+ kbd_is_internal = bus_tp != BUS_BLUETOOTH && -+ bus_kbd == bus_tp; -+ if (tp_is_internal && kbd_is_internal && -+ tp->dwt.keyboard == NULL) { -+ libinput_device_add_event_listener(&added_device->base, -+ &tp->dwt.keyboard_listener, -+ tp_keyboard_event, tp); -+ tp->dwt.keyboard = added_device; -+ tp->dwt.keyboard_active = false; -+ } - } - - if (tp->sendevents.current_mode != -diff --git a/src/evdev.c b/src/evdev.c -index 4ce9250..a98e801 100644 ---- a/src/evdev.c -+++ b/src/evdev.c -@@ -734,6 +734,25 @@ evdev_tag_trackpoint(struct evdev_device *device, - } - - static void -+evdev_tag_keyboard(struct evdev_device *device, -+ struct udev_device *udev_device) -+{ -+ int code; -+ -+ if (!libevdev_has_event_type(device->evdev, EV_KEY)) -+ return; -+ -+ for (code = KEY_Q; code <= KEY_P; code++) { -+ if (!libevdev_has_event_code(device->evdev, -+ EV_KEY, -+ code)) -+ return; -+ } -+ -+ device->tags |= EVDEV_TAG_KEYBOARD; -+} -+ -+static void - fallback_process(struct evdev_dispatch *dispatch, - struct evdev_device *device, - struct input_event *event, -@@ -772,6 +791,7 @@ fallback_tag_device(struct evdev_device *device, - { - evdev_tag_external_mouse(device, udev_device); - evdev_tag_trackpoint(device, udev_device); -+ evdev_tag_keyboard(device, udev_device); - } - - static int -diff --git a/src/evdev.h b/src/evdev.h -index 20c0b55..bd398de 100644 ---- a/src/evdev.h -+++ b/src/evdev.h -@@ -68,6 +68,7 @@ enum evdev_device_tags { - EVDEV_TAG_INTERNAL_TOUCHPAD = (1 << 1), - EVDEV_TAG_TRACKPOINT = (1 << 2), - EVDEV_TAG_TOUCHPAD_TRACKPOINT = (1 << 3), -+ EVDEV_TAG_KEYBOARD = (1 << 4), - }; - - enum evdev_middlebutton_state { --- -2.4.1 - diff --git a/0005-touchpad-be-finer-grained-about-when-to-pair-touchpa.patch b/0005-touchpad-be-finer-grained-about-when-to-pair-touchpa.patch deleted file mode 100644 index 0cadc69..0000000 --- a/0005-touchpad-be-finer-grained-about-when-to-pair-touchpa.patch +++ /dev/null @@ -1,154 +0,0 @@ -From f1a89760aa814787f0e1df43658b95bf88195592 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Fri, 22 May 2015 16:07:10 +1000 -Subject: [PATCH libinput 05/10] touchpad: be finer-grained about when to pair - touchpads/keyboard for DWT - -Check a couple of easy yes/no definitives that cover most Lenovo laptops, -and avoid false positives on Wacoms. - -Signed-off-by: Peter Hutterer -Reviewed-by: Hans de Goede -Tested-by: Benjamin Tissoires ---- - src/evdev-mt-touchpad.c | 54 +++++++++++++++++++++++++++++++++++-------------- - src/evdev-mt-touchpad.h | 2 -- - src/libinput-util.h | 3 +++ - test/device.c | 2 +- - test/touchpad.c | 2 +- - 5 files changed, 44 insertions(+), 19 deletions(-) - -diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c -index 5a05129..3a0985d 100644 ---- a/src/evdev-mt-touchpad.c -+++ b/src/evdev-mt-touchpad.c -@@ -938,15 +938,43 @@ tp_keyboard_event(uint64_t time, struct libinput_event *event, void *data) - time + timeout); - } - -+static bool -+tp_want_dwt(struct evdev_device *touchpad, -+ struct evdev_device *keyboard) -+{ -+ unsigned int bus_tp = libevdev_get_id_bustype(touchpad->evdev), -+ bus_kbd = libevdev_get_id_bustype(keyboard->evdev); -+ -+ if (bus_tp == BUS_BLUETOOTH || bus_kbd == BUS_BLUETOOTH) -+ return false; -+ -+ /* evemu will set the right bus type */ -+ if (bus_tp == BUS_VIRTUAL || bus_kbd == BUS_VIRTUAL) -+ return false; -+ -+ /* If the touchpad is on serio, the keyboard is too, so ignore any -+ other devices */ -+ if (bus_tp == BUS_I8042 && bus_kbd != bus_tp) -+ return false; -+ -+ /* Wacom makes touchpads, but not internal ones */ -+ if (libevdev_get_id_vendor(touchpad->evdev) == VENDOR_ID_WACOM) -+ return false; -+ -+ /* everything else we don't really know, so we have to assume -+ they go together */ -+ -+ return true; -+} -+ - static void - tp_device_added(struct evdev_device *device, - struct evdev_device *added_device) - { - struct tp_dispatch *tp = (struct tp_dispatch*)device->dispatch; - unsigned int bus_tp = libevdev_get_id_bustype(device->evdev), -- bus_trp = libevdev_get_id_bustype(added_device->evdev), -- bus_kbd = libevdev_get_id_bustype(added_device->evdev); -- bool tp_is_internal, trp_is_internal, kbd_is_internal; -+ bus_trp = libevdev_get_id_bustype(added_device->evdev); -+ bool tp_is_internal, trp_is_internal; - - tp_is_internal = bus_tp != BUS_USB && bus_tp != BUS_BLUETOOTH; - trp_is_internal = bus_trp != BUS_USB && bus_trp != BUS_BLUETOOTH; -@@ -962,18 +990,14 @@ tp_device_added(struct evdev_device *device, - tp_trackpoint_event, tp); - } - -- if (added_device->tags & EVDEV_TAG_KEYBOARD) { -- /* FIXME: detect external keyboard better */ -- kbd_is_internal = bus_tp != BUS_BLUETOOTH && -- bus_kbd == bus_tp; -- if (tp_is_internal && kbd_is_internal && -- tp->dwt.keyboard == NULL) { -- libinput_device_add_event_listener(&added_device->base, -- &tp->dwt.keyboard_listener, -- tp_keyboard_event, tp); -- tp->dwt.keyboard = added_device; -- tp->dwt.keyboard_active = false; -- } -+ if (added_device->tags & EVDEV_TAG_KEYBOARD && -+ tp->dwt.keyboard == NULL && -+ tp_want_dwt(device, added_device)) { -+ libinput_device_add_event_listener(&added_device->base, -+ &tp->dwt.keyboard_listener, -+ tp_keyboard_event, tp); -+ tp->dwt.keyboard = added_device; -+ tp->dwt.keyboard_active = false; - } - - if (tp->sendevents.current_mode != -diff --git a/src/evdev-mt-touchpad.h b/src/evdev-mt-touchpad.h -index f8c837d..db877c7 100644 ---- a/src/evdev-mt-touchpad.h -+++ b/src/evdev-mt-touchpad.h -@@ -32,8 +32,6 @@ - #define TOUCHPAD_HISTORY_LENGTH 4 - #define TOUCHPAD_MIN_SAMPLES 4 - --#define VENDOR_ID_APPLE 0x5ac -- - /* Convert mm to a distance normalized to DEFAULT_MOUSE_DPI */ - #define TP_MM_TO_DPI_NORMALIZED(mm) (DEFAULT_MOUSE_DPI/25.4 * mm) - -diff --git a/src/libinput-util.h b/src/libinput-util.h -index 74226b9..89f5230 100644 ---- a/src/libinput-util.h -+++ b/src/libinput-util.h -@@ -30,6 +30,9 @@ - - #include "libinput.h" - -+#define VENDOR_ID_APPLE 0x5ac -+#define VENDOR_ID_WACOM 0x56a -+ - void - set_logging_enabled(int enabled); - -diff --git a/test/device.c b/test/device.c -index 1c277ba..0e494c4 100644 ---- a/test/device.c -+++ b/test/device.c -@@ -69,7 +69,7 @@ START_TEST(device_sendevents_config_touchpad) - expected = LIBINPUT_CONFIG_SEND_EVENTS_DISABLED; - - /* The wacom devices in the test suite are external */ -- if (libevdev_get_id_vendor(dev->evdev) != 0x56a) /* wacom */ -+ if (libevdev_get_id_vendor(dev->evdev) != VENDOR_ID_WACOM) - expected |= - LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE; - -diff --git a/test/touchpad.c b/test/touchpad.c -index 576b2bd..2624dda 100644 ---- a/test/touchpad.c -+++ b/test/touchpad.c -@@ -2951,7 +2951,7 @@ touchpad_has_palm_detect_size(struct litest_device *dev) - double width, height; - int rc; - -- if (libinput_device_get_id_vendor(dev->libinput_device) == 0x5ac) /* Apple */ -+ if (libinput_device_get_id_vendor(dev->libinput_device) == ID_VENDOR_APPLE) - return 1; - - rc = libinput_device_get_size(dev->libinput_device, &width, &height); --- -2.4.1 - diff --git a/0006-touchpad-split-disable-while-typing-handling-into-a-.patch b/0006-touchpad-split-disable-while-typing-handling-into-a-.patch deleted file mode 100644 index 56e10de..0000000 --- a/0006-touchpad-split-disable-while-typing-handling-into-a-.patch +++ /dev/null @@ -1,59 +0,0 @@ -From c98229492ce59faf402f446da200658454ace9d5 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Thu, 21 May 2015 13:30:24 +1000 -Subject: [PATCH libinput 06/10] touchpad: split disable-while-typing handling - into a helper function - -Signed-off-by: Peter Hutterer -Reviewed-by: Hans de Goede -Tested-by: Benjamin Tissoires ---- - src/evdev-mt-touchpad.c | 25 ++++++++++++++++++------- - 1 file changed, 18 insertions(+), 7 deletions(-) - -diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c -index 3a0985d..ad20fb9 100644 ---- a/src/evdev-mt-touchpad.c -+++ b/src/evdev-mt-touchpad.c -@@ -478,6 +478,22 @@ tp_palm_tap_is_palm(struct tp_dispatch *tp, struct tp_touch *t) - return false; - } - -+static int -+tp_palm_detect_dwt(struct tp_dispatch *tp, struct tp_touch *t, uint64_t time) -+{ -+ if (!tp->dwt.keyboard_active) -+ return 0; -+ -+ if (t->state == TOUCH_BEGIN) { -+ t->palm.state = PALM_TYPING; -+ t->palm.time = time; -+ t->palm.first = t->point; -+ return 1; -+ } -+ -+ return 0; -+} -+ - static void - tp_palm_detect(struct tp_dispatch *tp, struct tp_touch *t, uint64_t time) - { -@@ -486,13 +502,8 @@ tp_palm_detect(struct tp_dispatch *tp, struct tp_touch *t, uint64_t time) - struct device_float_coords delta; - int dirs; - -- if (tp->dwt.keyboard_active && -- t->state == TOUCH_BEGIN) { -- t->palm.state = PALM_TYPING; -- t->palm.time = time; -- t->palm.first = t->point; -- return; -- } -+ if (tp_palm_detect_dwt(tp, t, time)) -+ return; - - /* If labelled a touch as palm, we unlabel as palm when - we move out of the palm edge zone within the timeout, provided --- -2.4.1 - diff --git a/0007-touchpad-add-palm-state-debugging.patch b/0007-touchpad-add-palm-state-debugging.patch deleted file mode 100644 index 4f8ef49..0000000 --- a/0007-touchpad-add-palm-state-debugging.patch +++ /dev/null @@ -1,85 +0,0 @@ -From 09a79656a27c42699f4a9c8d97df171938e009ef Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Fri, 22 May 2015 15:14:04 +1000 -Subject: [PATCH libinput 07/10] touchpad: add palm state debugging - -Signed-off-by: Peter Hutterer -Reviewed-by: Hans de Goede -Tested-by: Benjamin Tissoires ---- - src/evdev-mt-touchpad.c | 22 ++++++++++++++++++++-- - 1 file changed, 20 insertions(+), 2 deletions(-) - -diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c -index ad20fb9..56a70cc 100644 ---- a/src/evdev-mt-touchpad.c -+++ b/src/evdev-mt-touchpad.c -@@ -472,8 +472,11 @@ tp_palm_tap_is_palm(struct tp_dispatch *tp, struct tp_touch *t) - - /* We're inside the left/right palm edge and in the northern half of - * the touchpad - this tap is a palm */ -- if (t->point.y < tp->palm.vert_center) -+ if (t->point.y < tp->palm.vert_center) { -+ log_debug(tp_libinput_context(tp), -+ "palm: palm-tap detected\n"); - return true; -+ } - - return false; - } -@@ -503,7 +506,7 @@ tp_palm_detect(struct tp_dispatch *tp, struct tp_touch *t, uint64_t time) - int dirs; - - if (tp_palm_detect_dwt(tp, t, time)) -- return; -+ goto out; - - /* If labelled a touch as palm, we unlabel as palm when - we move out of the palm edge zone within the timeout, provided -@@ -517,6 +520,8 @@ tp_palm_detect(struct tp_dispatch *tp, struct tp_touch *t, uint64_t time) - tp_normalize_delta(tp, delta)); - if ((dirs & DIRECTIONS) && !(dirs & ~DIRECTIONS)) { - t->palm.state = PALM_NONE; -+ log_debug(tp_libinput_context(tp), -+ "palm: touch released, out of edge zone\n"); - } - } - return; -@@ -538,6 +543,11 @@ tp_palm_detect(struct tp_dispatch *tp, struct tp_touch *t, uint64_t time) - t->palm.state = PALM_EDGE; - t->palm.time = time; - t->palm.first = t->point; -+ -+out: -+ log_debug(tp_libinput_context(tp), -+ "palm: palm detected (%s)\n", -+ t->palm.state == PALM_EDGE ? "edge" : "typing"); - } - - static void -@@ -879,7 +889,10 @@ tp_keyboard_timeout(uint64_t now, void *data) - struct tp_dispatch *tp = data; - - tp_tap_resume(tp, now); -+ - tp->dwt.keyboard_active = false; -+ -+ log_debug(tp_libinput_context(tp), "palm: keyboard timeout\n"); - } - - static inline bool -@@ -1004,6 +1017,11 @@ tp_device_added(struct evdev_device *device, - if (added_device->tags & EVDEV_TAG_KEYBOARD && - tp->dwt.keyboard == NULL && - tp_want_dwt(device, added_device)) { -+ log_debug(tp_libinput_context(tp), -+ "palm: dwt activated with %s<->%s\n", -+ device->devname, -+ added_device->devname); -+ - libinput_device_add_event_listener(&added_device->base, - &tp->dwt.keyboard_listener, - tp_keyboard_event, tp); --- -2.4.1 - diff --git a/0008-touchpad-reset-the-touch-state-when-edge-scrolling-i.patch b/0008-touchpad-reset-the-touch-state-when-edge-scrolling-i.patch deleted file mode 100644 index 603fcaf..0000000 --- a/0008-touchpad-reset-the-touch-state-when-edge-scrolling-i.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 46bb2e4d7583fe7d6b07a3f9fd2270d1e54e2129 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Mon, 25 May 2015 11:36:34 +1000 -Subject: [PATCH libinput 08/10] touchpad: reset the touch state when edge - scrolling is stopped - -Signed-off-by: Peter Hutterer -Reviewed-by: Hans de Goede -Tested-by: Benjamin Tissoires ---- - src/evdev-mt-touchpad-edge-scroll.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/src/evdev-mt-touchpad-edge-scroll.c b/src/evdev-mt-touchpad-edge-scroll.c -index 9bf3f0c..f7eae9e 100644 ---- a/src/evdev-mt-touchpad-edge-scroll.c -+++ b/src/evdev-mt-touchpad-edge-scroll.c -@@ -438,6 +438,10 @@ tp_edge_scroll_stop_events(struct tp_dispatch *tp, uint64_t time) - &zero, - &zero_discrete); - t->scroll.direction = -1; -+ /* reset touch to area state, avoids loading the -+ * state machine with special case handling */ -+ t->scroll.edge = EDGE_NONE; -+ t->scroll.edge_state = EDGE_SCROLL_TOUCH_STATE_AREA; - } - } - } --- -2.4.1 - diff --git a/0009-touchpad-don-t-enable-edge-palm-detection-on-Wacom-t.patch b/0009-touchpad-don-t-enable-edge-palm-detection-on-Wacom-t.patch deleted file mode 100644 index bee74eb..0000000 --- a/0009-touchpad-don-t-enable-edge-palm-detection-on-Wacom-t.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 322d7f2302c61def6deb6c7cc7a406b4f85b880d Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Mon, 25 May 2015 16:02:56 +1000 -Subject: [PATCH libinput 09/10] touchpad: don't enable edge palm detection on - Wacom touchpads - -Signed-off-by: Peter Hutterer -Reviewed-by: Hans de Goede -Tested-by: Benjamin Tissoires ---- - src/evdev-mt-touchpad.c | 10 ++++++++-- - test/touchpad.c | 6 +++++- - 2 files changed, 13 insertions(+), 3 deletions(-) - -diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c -index 56a70cc..9a04893 100644 ---- a/src/evdev-mt-touchpad.c -+++ b/src/evdev-mt-touchpad.c -@@ -1299,6 +1299,7 @@ tp_init_palmdetect(struct tp_dispatch *tp, - struct evdev_device *device) - { - int width, height; -+ unsigned int vendor_id; - - tp->palm.right_edge = INT_MAX; - tp->palm.left_edge = INT_MIN; -@@ -1309,8 +1310,13 @@ tp_init_palmdetect(struct tp_dispatch *tp, - height = abs(device->abs.absinfo_y->maximum - - device->abs.absinfo_y->minimum); - -- /* Apple touchpads are always big enough to warrant palm detection */ -- if (evdev_device_get_id_vendor(device) != VENDOR_ID_APPLE) { -+ vendor_id = evdev_device_get_id_vendor(device); -+ -+ /* Wacom doesn't have internal touchpads, -+ * Apple touchpads are always big enough to warrant palm detection */ -+ if (vendor_id == VENDOR_ID_WACOM) { -+ return 0; -+ } else if (vendor_id != VENDOR_ID_APPLE) { - /* We don't know how big the touchpad is */ - if (device->abs.absinfo_x->resolution == 1) - return 0; -diff --git a/test/touchpad.c b/test/touchpad.c -index 2624dda..e33d0e1 100644 ---- a/test/touchpad.c -+++ b/test/touchpad.c -@@ -2949,9 +2949,13 @@ static int - touchpad_has_palm_detect_size(struct litest_device *dev) - { - double width, height; -+ unsigned int vendor; - int rc; - -- if (libinput_device_get_id_vendor(dev->libinput_device) == ID_VENDOR_APPLE) -+ vendor = libinput_device_get_id_vendor(dev->libinput_device); -+ if (vendor == VENDOR_ID_WACOM) -+ return 0; -+ if (vendor == VENDOR_ID_APPLE) - return 1; - - rc = libinput_device_get_size(dev->libinput_device, &width, &height); --- -2.4.1 - diff --git a/0010-touchpad-touches-after-the-last-key-press-can-be-rel.patch b/0010-touchpad-touches-after-the-last-key-press-can-be-rel.patch deleted file mode 100644 index 84a866d..0000000 --- a/0010-touchpad-touches-after-the-last-key-press-can-be-rel.patch +++ /dev/null @@ -1,122 +0,0 @@ -From 1c02bc3dc932c1df2dada0cb814e7401a23c65e8 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Thu, 21 May 2015 16:32:42 +1000 -Subject: [PATCH libinput 10/10] touchpad: touches after the last key press can - be released - -The current code labels a touch as palm if it started within the typing -timeouts. To move the pointer even after the timeout expires, a user has to -lift the finger which is quite annoying and different to the old synaptics -driver behaviour (which had a simple on/off toggle on whether to let events -through or not). - -Be smarter about this: if a touch starts _after_ the last key press event, -release it for pointer motion once the timeout expires. Touches started before -the last key press remain labelled as palms. This makes it possible to rest -the palm on the touchpad while typing without getting interference but also -provides a more responsive UI when moving from typing to using the touchpad -normally. - -Signed-off-by: Peter Hutterer -Reviewed-by: Hans de Goede -Tested-by: Benjamin Tissoires ---- - doc/palm-detection.dox | 1 - - src/evdev-mt-touchpad-edge-scroll.c | 3 +++ - src/evdev-mt-touchpad.c | 24 ++++++++++++++++++++---- - src/evdev-mt-touchpad.h | 2 ++ - 4 files changed, 25 insertions(+), 5 deletions(-) - -diff --git a/doc/palm-detection.dox b/doc/palm-detection.dox -index a5b578b..7c848e3 100644 ---- a/doc/palm-detection.dox -+++ b/doc/palm-detection.dox -@@ -57,5 +57,4 @@ the palm on the touchpad while using the trackstick). - If the touchpad is disabled, the @ref t440_support "top software buttons" - remain enabled. - -- - */ -diff --git a/src/evdev-mt-touchpad-edge-scroll.c b/src/evdev-mt-touchpad-edge-scroll.c -index f7eae9e..8a4d892 100644 ---- a/src/evdev-mt-touchpad-edge-scroll.c -+++ b/src/evdev-mt-touchpad-edge-scroll.c -@@ -361,6 +361,9 @@ tp_edge_scroll_post_events(struct tp_dispatch *tp, uint64_t time) - if (!t->dirty) - continue; - -+ if (t->palm.state != PALM_NONE) -+ continue; -+ - switch (t->scroll.edge) { - case EDGE_NONE: - if (t->scroll.direction != -1) { -diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c -index 9a04893..94a3376 100644 ---- a/src/evdev-mt-touchpad.c -+++ b/src/evdev-mt-touchpad.c -@@ -237,6 +237,7 @@ tp_end_touch(struct tp_dispatch *tp, struct tp_touch *t, uint64_t time) - t->state = TOUCH_END; - t->pinned.is_pinned = false; - t->millis = time; -+ t->palm.time = 0; - assert(tp->nfingers_down >= 1); - tp->nfingers_down--; - tp->queued |= TOUCHPAD_EVENT_MOTION; -@@ -484,14 +485,28 @@ tp_palm_tap_is_palm(struct tp_dispatch *tp, struct tp_touch *t) - static int - tp_palm_detect_dwt(struct tp_dispatch *tp, struct tp_touch *t, uint64_t time) - { -- if (!tp->dwt.keyboard_active) -- return 0; -- -- if (t->state == TOUCH_BEGIN) { -+ if (tp->dwt.keyboard_active && -+ t->state == TOUCH_BEGIN) { - t->palm.state = PALM_TYPING; - t->palm.time = time; - t->palm.first = t->point; - return 1; -+ } else if (!tp->dwt.keyboard_active && -+ t->state == TOUCH_UPDATE && -+ t->palm.state == PALM_TYPING) -+ { -+ /* If a touch has started before the first or after the last -+ key press, release it on timeout. Benefit: a palm rested -+ while typing on the touchpad will be ignored, but a touch -+ started once we stop typing will be able to control the -+ pointer (alas not tap, etc.). -+ */ -+ if (t->palm.time == 0 || -+ t->palm.time > tp->dwt.keyboard_last_press_time) { -+ t->palm.state = PALM_NONE; -+ log_debug(tp_libinput_context(tp), -+ "palm: touch released, timeout after typing\n"); -+ } - } - - return 0; -@@ -958,6 +973,7 @@ tp_keyboard_event(uint64_t time, struct libinput_event *event, void *data) - timeout = DEFAULT_KEYBOARD_ACTIVITY_TIMEOUT_2; - } - -+ tp->dwt.keyboard_last_press_time = time; - libinput_timer_set(&tp->dwt.keyboard_timer, - time + timeout); - } -diff --git a/src/evdev-mt-touchpad.h b/src/evdev-mt-touchpad.h -index db877c7..d086192 100644 ---- a/src/evdev-mt-touchpad.h -+++ b/src/evdev-mt-touchpad.h -@@ -284,6 +284,8 @@ struct tp_dispatch { - struct libinput_event_listener keyboard_listener; - struct libinput_timer keyboard_timer; - struct evdev_device *keyboard; -+ -+ uint64_t keyboard_last_press_time; - } dwt; - }; - --- -2.4.1 - diff --git a/libinput.spec b/libinput.spec index 5651e2a..1dd25fe 100644 --- a/libinput.spec +++ b/libinput.spec @@ -4,8 +4,8 @@ %global gitversion 58abea394 Name: libinput -Version: 0.15.0 -Release: 4%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} +Version: 0.16.0 +Release: 1%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} Summary: Input device library License: MIT @@ -18,24 +18,6 @@ Source2: commitid Source0: http://www.freedesktop.org/software/libinput/libinput-%{version}.tar.xz %endif -Patch01: 0001-touchpad-switch-from-is_palm-to-an-enum.patch -Patch02: 0002-touchpad-add-timeout-based-disable-while-typing.patch -Patch03: 0003-touchpad-use-a-two-stage-timeout-for-disable-while-t.patch - -Patch04: 0001-touchpad-move-disable-while-typing-into-its-own-stru.patch -Patch05: 0002-touchpad-extend-the-key-blacklist-for-disable-while-.patch -Patch06: 0003-touchpad-add-helper-function-to-get-from-tp-to-the-l.patch -Patch07: 0004-touchpad-only-check-keyboards-for-disable-while-typi.patch -Patch08: 0005-touchpad-be-finer-grained-about-when-to-pair-touchpa.patch -Patch09: 0006-touchpad-split-disable-while-typing-handling-into-a-.patch -Patch10: 0007-touchpad-add-palm-state-debugging.patch -Patch11: 0008-touchpad-reset-the-touch-state-when-edge-scrolling-i.patch -Patch12: 0009-touchpad-don-t-enable-edge-palm-detection-on-Wacom-t.patch -Patch13: 0010-touchpad-touches-after-the-last-key-press-can-be-rel.patch - -# Bug 1225998 - Tap-and-drag touchpad behavior not configurable -Patch14: 0001-touchpad-end-tap-and-drag-with-an-extra-tap.patch - BuildRequires: git BuildRequires: autoconf automake libtool pkgconfig BuildRequires: libevdev-devel @@ -111,6 +93,9 @@ find $RPM_BUILD_ROOT -name '*.la' -delete %changelog +* Tue Jun 02 2015 Peter Hutterer 0.16.0-1 +- libinput 0.16.0 + * Fri May 29 2015 Peter Hutterer 0.15.0-4 - Add tap-to-end-drag patch (#1225998) diff --git a/sources b/sources index c74cc35..a3b4904 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -f2e559ac926cb4afac6951e097364ab1 libinput-0.15.0.tar.xz +a5f5e1bb8eb2cd3bb9f5bd48f296def8 libinput-0.16.0.tar.xz