From 7a9883d5bb0f231bbf11f120ade68000c41c9aa1 Mon Sep 17 00:00:00 2001 From: Sebastian Wick Date: Thu, 2 May 2024 18:02:55 +0200 Subject: [PATCH] window: Move implement_showing for the next commit Part-of: --- src/core/window.c | 90 +++++++++++++++++++++++------------------------ 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/src/core/window.c b/src/core/window.c index 1411d355c..75e9bbadf 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -1783,51 +1783,6 @@ meta_window_should_be_showing (MetaWindow *window) return meta_window_should_be_showing_on_workspace (window, active_workspace); } -static void -implement_showing (MetaWindow *window, - gboolean showing) -{ - /* Actually show/hide the window */ - meta_verbose ("Implement showing = %d for window %s", - showing, window->desc); - - /* Some windows are not stackable until being showed, so add those now. */ - if (meta_window_is_stackable (window) && !meta_window_is_in_stack (window)) - meta_stack_add (window->display->stack, window); - - if (!showing) - { - /* When we manage a new window, we normally delay placing it - * until it is is first shown, but if we're previewing hidden - * windows we might want to know where they are on the screen, - * so we should place the window even if we're hiding it rather - * than showing it. - * Force placing windows only when they should be already mapped, - * see #751887 - */ - if (!window->placed && window_has_buffer (window)) - meta_window_force_placement (window, FALSE); - - meta_window_hide (window); - - if (!window->override_redirect) - sync_client_window_mapped (window); - } - else - { - if (!window->override_redirect) - sync_client_window_mapped (window); - - meta_window_show (window); - } -} - -void -meta_window_update_visibility (MetaWindow *window) -{ - implement_showing (window, meta_window_should_be_showing (window)); -} - void meta_window_clear_queued (MetaWindow *window) { @@ -2243,6 +2198,51 @@ meta_window_is_suspended (MetaWindow *window) g_assert_not_reached (); } +static void +implement_showing (MetaWindow *window, + gboolean showing) +{ + /* Actually show/hide the window */ + meta_verbose ("Implement showing = %d for window %s", + showing, window->desc); + + /* Some windows are not stackable until being showed, so add those now. */ + if (meta_window_is_stackable (window) && !meta_window_is_in_stack (window)) + meta_stack_add (window->display->stack, window); + + if (!showing) + { + /* When we manage a new window, we normally delay placing it + * until it is is first shown, but if we're previewing hidden + * windows we might want to know where they are on the screen, + * so we should place the window even if we're hiding it rather + * than showing it. + * Force placing windows only when they should be already mapped, + * see #751887 + */ + if (!window->placed && window_has_buffer (window)) + meta_window_force_placement (window, FALSE); + + meta_window_hide (window); + + if (!window->override_redirect) + sync_client_window_mapped (window); + } + else + { + if (!window->override_redirect) + sync_client_window_mapped (window); + + meta_window_show (window); + } +} + +void +meta_window_update_visibility (MetaWindow *window) +{ + implement_showing (window, meta_window_should_be_showing (window)); +} + static void meta_window_show (MetaWindow *window) {