mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-08 11:19:14 +02:00
touchpad: drop the two-finger limit during tap-and-drag
This interferes with an upcoming feature allowing new actions involving additional fingers, including during a tap-and-drag. Signed-off-by: satrmb <10471-satrmb@users.noreply.gitlab.freedesktop.org>
This commit is contained in:
parent
d2d7b59245
commit
71ad1768e0
3 changed files with 23 additions and 19 deletions
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 173 KiB After Width: | Height: | Size: 171 KiB |
|
|
@ -429,13 +429,6 @@ tp_drag_dragging_handle_event(struct tp_dispatch *tp,
|
|||
|
||||
switch (event) {
|
||||
case TAP_EVENT_TOUCH:
|
||||
if (tp->tap.nfingers_down > 2) {
|
||||
tp_tap_notify(tp,
|
||||
time,
|
||||
nfingers_tapped,
|
||||
LIBINPUT_BUTTON_STATE_RELEASED);
|
||||
tp->tap.drag_state = DRAG_STATE_IDLE;
|
||||
}
|
||||
break;
|
||||
case TAP_EVENT_RELEASE:
|
||||
if (tp->tap.nfingers_down == 0) {
|
||||
|
|
@ -1027,7 +1020,10 @@ tp_tap_touch3_handle_event(struct tp_dispatch *tp,
|
|||
tp_tap_move_to_dead(tp, t);
|
||||
break;
|
||||
case TAP_EVENT_TIMEOUT:
|
||||
tp->tap.state = TAP_STATE_TOUCH_3_HOLD;
|
||||
if (tp->tap.drag_state == DRAG_STATE_IDLE)
|
||||
tp->tap.state = TAP_STATE_TOUCH_3_HOLD;
|
||||
else
|
||||
tp->tap.state = TAP_STATE_DEAD;
|
||||
tp_tap_clear_timer(tp);
|
||||
tp_gesture_tap_timeout(tp, time);
|
||||
break;
|
||||
|
|
@ -1115,7 +1111,10 @@ tp_tap_touch3_release_handle_event(struct tp_dispatch *tp,
|
|||
break;
|
||||
case TAP_EVENT_TIMEOUT:
|
||||
tp_drag_handle_event(tp, t, TAP_EVENT_3FGTAP, time);
|
||||
tp->tap.state = TAP_STATE_TOUCH_2_HOLD;
|
||||
if (tp->tap.drag_state == DRAG_STATE_IDLE)
|
||||
tp->tap.state = TAP_STATE_TOUCH_2_HOLD;
|
||||
else
|
||||
tp->tap.state = TAP_STATE_DEAD;
|
||||
break;
|
||||
case TAP_EVENT_BUTTON:
|
||||
tp_drag_handle_event(tp, t, TAP_EVENT_3FGTAP, time);
|
||||
|
|
@ -1160,7 +1159,10 @@ tp_tap_touch3_release2_handle_event(struct tp_dispatch *tp,
|
|||
break;
|
||||
case TAP_EVENT_TIMEOUT:
|
||||
tp_drag_handle_event(tp, t, TAP_EVENT_3FGTAP, time);
|
||||
tp->tap.state = TAP_STATE_HOLD;
|
||||
if (tp->tap.drag_state == DRAG_STATE_IDLE)
|
||||
tp->tap.state = TAP_STATE_HOLD;
|
||||
else
|
||||
tp->tap.state = TAP_STATE_DEAD;
|
||||
break;
|
||||
case TAP_EVENT_BUTTON:
|
||||
tp_drag_handle_event(tp, t, TAP_EVENT_3FGTAP, time);
|
||||
|
|
|
|||
|
|
@ -1975,22 +1975,23 @@ START_TEST(touchpad_tap_n_drag_3fg_btntool)
|
|||
|
||||
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
|
||||
|
||||
/* Putting down a third finger should end the drag */
|
||||
/* Putting down a third finger should not cause any events */
|
||||
litest_event(dev, EV_KEY, BTN_TOOL_TRIPLETAP, 1);
|
||||
litest_event(dev, EV_KEY, BTN_TOOL_DOUBLETAP, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li, button,
|
||||
LIBINPUT_BUTTON_STATE_RELEASED);
|
||||
litest_assert_empty_queue(li);
|
||||
|
||||
/* Releasing the fingers should not cause any events */
|
||||
/* Releasing the fingers should end the drag */
|
||||
litest_event(dev, EV_KEY, BTN_TOOL_TRIPLETAP, 0);
|
||||
litest_event(dev, EV_KEY, BTN_TOOL_DOUBLETAP, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
litest_touch_up(dev, 1);
|
||||
litest_touch_up(dev, 0);
|
||||
|
||||
litest_assert_button_event(li, button,
|
||||
LIBINPUT_BUTTON_STATE_RELEASED);
|
||||
litest_assert_empty_queue(li);
|
||||
}
|
||||
END_TEST
|
||||
|
|
@ -2069,19 +2070,20 @@ START_TEST(touchpad_tap_n_drag_3fg)
|
|||
|
||||
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
|
||||
|
||||
/* Putting down a third finger should end the drag */
|
||||
/* Putting down a third finger should still do nothing */
|
||||
litest_touch_down(dev, 2, 50, 50);
|
||||
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li, button,
|
||||
LIBINPUT_BUTTON_STATE_RELEASED);
|
||||
litest_assert_empty_queue(li);
|
||||
|
||||
/* Releasing the fingers should not cause any events */
|
||||
/* Releasing the fingers should end the drag */
|
||||
litest_touch_up(dev, 2);
|
||||
litest_touch_up(dev, 1);
|
||||
litest_touch_up(dev, 0);
|
||||
|
||||
litest_assert_button_event(li, button,
|
||||
LIBINPUT_BUTTON_STATE_RELEASED);
|
||||
litest_assert_empty_queue(li);
|
||||
}
|
||||
END_TEST
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue