Skip to content

x11: Update X11 focus before updating MetaDisplay focus

Iain Lane requested to merge cherry-pick-71c3f4af into gnome-3-34

In a similar vein to commit 8fd55fef. This notably failed when setting the focus on the stage (eg. to redirect key events to Clutter actors). Deeper in MetaDisplay focus updating machinery, it would check meta_stage_is_focused() which would still return FALSE at the time it's called.

This would not typically have side effects, but our "App does not respond" dialogs see the focus change under their feet, so they try to bring themselves to focus again. This results in a feedback loop.

Changing the order results in later checks on the X11 POV of the focus being correct, so focus is not mistakenly stolen from the close dialog, and it actually succeeds in keeping the key focus.

Fixes: gnome-shell#1607 (closed)

!876 (merged)

(cherry picked from commit 71c3f4af)

Merge request reports