From 133931e3a381ad5a36e9b16974a9d2d0600a3e25 Mon Sep 17 00:00:00 2001 From: Sebastian Keller Date: Sat, 19 Aug 2023 18:40:56 +0200 Subject: [PATCH] core: Don't unmap XWayland windows without buffers on visibility update 18be74ed was changing meta_window_should_be_showing_on_workspace() to only show XWayland windows when they have buffers to prevent starting transitions with a seemingly black window. This however did not just delay the transition, but when called in meta_window_update_visibility() could result in the X11 window getting unmapped again if the call happens before there is a buffer. Then, depending on the client, the window would either remain hidden or if the client tries to map the window again, this would repeat the process, triggering the closing transition every time. This commit instead just hides the XWayland window from the compositor but keeps the corresponding X11 window mapped while it does not have a buffer yet. Related: https://gitlab.gnome.org/GNOME/mutter/-/issues/2611 Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2965 Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2820 Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2867 Part-of: --- src/core/window.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/window.c b/src/core/window.c index dca30a1c5..8d75ba06f 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -1688,8 +1688,11 @@ gboolean meta_window_should_be_showing_on_workspace (MetaWindow *window, MetaWorkspace *workspace) { - if (!window_has_buffer (window)) +#ifdef HAVE_WAYLAND + if (window->client_type == META_WINDOW_CLIENT_TYPE_WAYLAND && + !window_has_buffer (window)) return FALSE; +#endif if (window->client_type == META_WINDOW_CLIENT_TYPE_X11 && window->decorated && !window->frame) @@ -2217,7 +2220,7 @@ meta_window_show (MetaWindow *window) set_wm_state (window); } - if (!window->visible_to_compositor) + if (!window->visible_to_compositor && window_has_buffer (window)) { MetaCompEffect effect = META_COMP_EFFECT_NONE;