mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-27 16:10:07 +01:00
touchpad: set keyboard to non-active when the keyboard is removed
If the keyboard is removed while dwt thinks it is in active state, that state is never reset and subsequent touches are ignored. https://bugs.freedesktop.org/show_bug.cgi?id=101743 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
756c7e3dac
commit
9e5d1df4bb
2 changed files with 43 additions and 0 deletions
|
|
@ -1855,6 +1855,7 @@ tp_interface_device_removed(struct evdev_device *device,
|
|||
libinput_device_remove_event_listener(
|
||||
&tp->dwt.keyboard_listener);
|
||||
tp->dwt.keyboard = NULL;
|
||||
tp->dwt.keyboard_active = false;
|
||||
}
|
||||
|
||||
if (removed_device == tp->lid_switch.lid_switch) {
|
||||
|
|
|
|||
|
|
@ -4127,6 +4127,47 @@ START_TEST(touchpad_dwt_enable_during_tap)
|
|||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(touchpad_dwt_remove_kbd_while_active)
|
||||
{
|
||||
struct litest_device *touchpad = litest_current_device();
|
||||
struct litest_device *keyboard;
|
||||
struct libinput *li = touchpad->libinput;
|
||||
|
||||
if (!has_disable_while_typing(touchpad))
|
||||
return;
|
||||
|
||||
litest_enable_tap(touchpad->libinput_device);
|
||||
enable_dwt(touchpad);
|
||||
|
||||
keyboard = dwt_init_paired_keyboard(li, touchpad);
|
||||
litest_drain_events(li);
|
||||
|
||||
litest_keyboard_key(keyboard, KEY_A, true);
|
||||
litest_keyboard_key(keyboard, KEY_A, false);
|
||||
libinput_dispatch(li);
|
||||
|
||||
litest_touch_down(touchpad, 0, 50, 50);
|
||||
libinput_dispatch(li);
|
||||
|
||||
litest_keyboard_key(keyboard, KEY_A, true);
|
||||
litest_keyboard_key(keyboard, KEY_A, false);
|
||||
litest_drain_events(li);
|
||||
|
||||
litest_delete_device(keyboard);
|
||||
litest_drain_events(li);
|
||||
|
||||
litest_touch_move_to(touchpad, 0, 50, 50, 70, 50, 10, 1);
|
||||
litest_touch_up(touchpad, 0);
|
||||
litest_assert_empty_queue(li);
|
||||
|
||||
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);
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(touchpad_dwt_apple)
|
||||
{
|
||||
struct litest_device *touchpad = litest_current_device();
|
||||
|
|
@ -5359,6 +5400,7 @@ litest_setup_tests_touchpad(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("touchpad:dwt", touchpad_dwt_remove_kbd_while_active, LITEST_TOUCHPAD, LITEST_ANY);
|
||||
litest_add_for_device("touchpad:dwt", touchpad_dwt_apple, LITEST_BCM5974);
|
||||
litest_add_for_device("touchpad:dwt", touchpad_dwt_acer_hawaii, LITEST_ACER_HAWAII_TOUCHPAD);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue