Skip to content

gdk/wayland: Clear modifiers when we lose keyboard focus

Matthias Clasen requested to merge cherry-picked-wayland-keyboard-fix into master

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 (closed)

Merge request reports