summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2022-11-20 19:24:07 +0100
committerMarge Bot <marge-bot@gnome.org>2022-12-01 20:10:52 +0000
commita60863838e4a263f1d3ff1327eba59a72e33656b (patch)
tree813ac732117459aea791ecc3197ef6676a68373e
parent9135931385fb388381e15217f052eabdddc60f57 (diff)
downloadmutter-a60863838e4a263f1d3ff1327eba59a72e33656b.tar.gz
core: Synchronize client window mapped state before showing window
The meta_window_show() method internally relies on window->mapped being up-to-date, or attempting to focus it may fail since the window is not mapped yet, resulting on the window being mapped, but not focused as it would be expected. This is moot so far, since windows with frames are created sort-of synchronously and showing them will result in the focus attempt happening when the window is already mapped, but things will break when this becomes an asynchronous step. Ensure to synchronize client state before showing, so any attempts to focus the window are able to succeed despite the initial state when calling meta_window_update_visibility(). Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2175>
-rw-r--r--src/core/window.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/core/window.c b/src/core/window.c
index e0f42e942..f69d55c2a 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -1741,12 +1741,17 @@ implement_showing (MetaWindow *window,
meta_window_force_placement (window, FALSE);
meta_window_hide (window);
+
+ if (!window->override_redirect)
+ sync_client_window_mapped (window);
}
else
- meta_window_show (window);
+ {
+ if (!window->override_redirect)
+ sync_client_window_mapped (window);
- if (!window->override_redirect)
- sync_client_window_mapped (window);
+ meta_window_show (window);
+ }
}
void