Commit 7444b15d authored by Jan Alexander Steffens's avatar Jan Alexander Steffens Committed by Matthias Clasen

gdk/wayland: Clear modifiers when we lose keyboard focus

When we `Alt+Tab` away from a GTK application, it loses keyboard focus.
If we don't clear the modifiers, events from other devices that we
receive while unfocused will assume `Alt` is still pressed. This results
in e.g. Firefox navigating through the history instead of scrolling the
page when using the mouse wheel on it.

We don't get any information about modifiers while we are missing
keyboard focus, so assuming no modifiers are active is the best we can
do.

The shell sends us a modifier update immediately before we regain
keyboard focus, so the state shouldn't get out of sync.

Fixes #2112
parent dd625abf
Pipeline #166400 passed with stages
in 24 minutes and 32 seconds
......@@ -1934,6 +1934,7 @@ keyboard_handle_leave (void *data,
g_object_unref (seat->keyboard_focus);
seat->keyboard_focus = NULL;
seat->repeat_key = 0;
seat->key_modifiers = 0;
GDK_SEAT_NOTE (seat, EVENTS,
g_message ("focus out, seat %p surface %p",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment