Skip to content
Commit 12ce58db authored by Carlos Garnacho's avatar Carlos Garnacho Committed by Jonas Ådahl
Browse files

x11: Avoid updating focus on wayland compositor

Reading upon the history of this code branch (commits 6891ce95
and 7a4c808e are most relevant), it seems this code is meant to
synchronize Mutter focus state taking the Xserver state as true.
That is, if Mutter tried to change the focus but something truncated
that action, Mutter focus will be changed to be in sync with the
Xserver again.

This sounds backwards in a Wayland session. Mutter focus should be
the canonical source, and not second-guessed from the current Xserver
focus window. These race conditions might still apply between X11
clients, so make these paths only apply in that case.

An example of this breaking can be reproduced with a Spotify and
Firefox window, moving the focus from the first to the second by
going to the GNOME Shell overview in between, and clicking the
Firefox window from there. The Firefox window will be raised, but
refuse to take focus.

It's unclear what made this an issue recently, perhaps commit
0e6395d9 since the now possibly ignored XI_FocusIn/Out events
affect this accounting of the Xserver focused window. Anyhow it
sounds better to ignore these paths for Wayland/native altogether.



(cherry picked from commit 81c0cf08)

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2848>
parent a8a34818
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