Skip to content

core: Account for the globally active input case

Olivier Fourdan requested to merge ofourdan/mutter:issue1620 into master

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 being un-managed or ones that actually accept focus.

Fixes: afa43154 - "core: Make sure focus_default_window() worked" Close: #1620 (closed)

Merge request reports