summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2016-02-08 11:48:51 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2016-02-09 07:40:04 +1000
commit0e87dc9af2be104fd6cfa50e5f013068e42666d4 (patch)
tree46d9844c42e0de024eb49b5b63b631966dc62ca4 /src
parent4392cb5796fb02e92418fbce192cfdb1fd5c9107 (diff)
touchpad: fix dwt disabling while a key is still down
If dwt is disabled on the commandline, e.g. by setting an xinput property it may be disabled before the release event comes in. This caused the timer to refresh indefinitely since the key state mask was still on for that key. Always updating the key state mask (even when dwt is disabled) fixes that. If a key is held down while dwt is disabled, this can still cause a indefinite timer refresh, so in the timer func, check if dwt is enabled before refreshing the timer. https://bugs.freedesktop.org/show_bug.cgi?id=94015 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/evdev-mt-touchpad.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index f7d5d873..1f654e45 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -1196,7 +1196,8 @@ tp_keyboard_timeout(uint64_t now, void *data)
{
struct tp_dispatch *tp = data;
- if (long_any_bit_set(tp->dwt.key_mask,
+ if (tp->dwt.dwt_enabled &&
+ long_any_bit_set(tp->dwt.key_mask,
ARRAY_LENGTH(tp->dwt.key_mask))) {
libinput_timer_set(&tp->dwt.keyboard_timer,
now + DEFAULT_KEYBOARD_ACTIVITY_TIMEOUT_2);
@@ -1251,9 +1252,6 @@ tp_keyboard_event(uint64_t time, struct libinput_event *event, void *data)
unsigned int timeout;
unsigned int key;
- if (!tp->dwt.dwt_enabled)
- return;
-
if (event->type != LIBINPUT_EVENT_KEYBOARD_KEY)
return;
@@ -1267,6 +1265,9 @@ tp_keyboard_event(uint64_t time, struct libinput_event *event, void *data)
return;
}
+ if (!tp->dwt.dwt_enabled)
+ return;
+
/* modifier keys don't trigger disable-while-typing so things like
* ctrl+zoom or ctrl+click are possible */
if (tp_key_ignore_for_dwt(key))