Skip to content

[Backport to 3.38] core: Account for the globally active input case

Commit afa43154 tried to make sure the focus was properly changed when calling focus_default_window() by checking the focused window just after trying to set the focus.

However, the X11 “Inter-Client Communication Conventions Manual” version 2.0 (ICCCM 2 for short) states that some X11 client may want to use a so called “globally active input” model in which case the client expects keyboard input and set input focus even when it's not one of its own window.

To comply with this, when dealing with such clients, mutter will not change the focus and send a WM_TAKE_FOCUS message instead.

That mechanism will defeat the logic introduced by commit afa43154 because the focused window is not changed in this case. As a result, the input focus will fallback to the no-focus window.

To avoid this, only check that the focus change occurred for windows using a synchronous focus model.

This is a backport of !1716 (merged) to %GNOME 3.38

Edited by Olivier Fourdan

Merge request reports