input: Fix bug in idle inhibition

Server generated key repeats are ignored - and they don't generate
matching release events. We early return to avoid generating events
for them.

We also need to push the idle inhibition counting after that early
return to prevent breaking idle inhibition with unmatched events.

Co-authored-by: Steve Pronovost <spronovo@microsoft.com>
Co-authored-by: Brenton DeGeer <brdegeer@microsoft.com>
Signed-off-by: Hideyuki Nagase <hideyukn@microsoft.com>
Signed-off-by: Steve Pronovost <spronovo@microsoft.com>
Signed-off-by: Brenton DeGeer <brdegeer@microsoft.com>
dev
Hideyuki Nagase 3 years ago committed by Daniel Stone
parent c2f4201ed2
commit 8fb529bc31
  1. 12
      libweston/input.c

@ -2197,12 +2197,6 @@ notify_key(struct weston_seat *seat, const struct timespec *time, uint32_t key,
struct weston_keyboard_grab *grab = keyboard->grab;
uint32_t *k, *end;
if (state == WL_KEYBOARD_KEY_STATE_PRESSED) {
weston_compositor_idle_inhibit(compositor);
} else {
weston_compositor_idle_release(compositor);
}
end = keyboard->keys.data + keyboard->keys.size;
for (k = keyboard->keys.data; k < end; k++) {
if (*k == key) {
@ -2218,6 +2212,12 @@ notify_key(struct weston_seat *seat, const struct timespec *time, uint32_t key,
*k = key;
}
if (state == WL_KEYBOARD_KEY_STATE_PRESSED) {
weston_compositor_idle_inhibit(compositor);
} else {
weston_compositor_idle_release(compositor);
}
if (grab == &keyboard->default_grab ||
grab == &keyboard->input_method_grab) {
weston_compositor_run_key_binding(compositor, keyboard, time,

Loading…
Cancel
Save