From 5a231a4d2789e84d3222354b3fef0718a94c9561 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Tue, 12 Nov 2024 14:59:38 +0100 Subject: [PATCH] window: Add a window helper function for MetaWindowConfig The MetaWindowConfig can indicate whether the configuration reflects on the initial configuration, before the window is first mapped. Add a smaller helper (private) window function to create the appropriate "type" of MetaWindowConfig depending whether the window was already showed or not. This is preparation work for the following commits where this function will be used. Part-of: --- src/core/window-private.h | 2 ++ src/core/window.c | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/src/core/window-private.h b/src/core/window-private.h index f7ebb2ad9..ba1973bd9 100644 --- a/src/core/window-private.h +++ b/src/core/window-private.h @@ -896,3 +896,5 @@ gboolean meta_window_is_tiled_side_by_side (MetaWindow *window); gboolean meta_window_is_tiled_left (MetaWindow *window); gboolean meta_window_is_tiled_right (MetaWindow *window); + +MetaWindowConfig * meta_window_new_window_config (MetaWindow *window); diff --git a/src/core/window.c b/src/core/window.c index 7504deff6..e23651c3d 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -72,6 +72,7 @@ #include "core/boxes-private.h" #include "core/constraints.h" #include "core/keybindings-private.h" +#include "core/meta-window-config-private.h" #include "core/meta-workspace-manager-private.h" #include "core/place.h" #include "core/stack.h" @@ -8241,3 +8242,12 @@ meta_window_get_client_content_rect (MetaWindow *window, meta_window_frame_rect_to_client_rect (window, rect, rect); #endif } + +MetaWindowConfig * +meta_window_new_window_config (MetaWindow *window) +{ + if (window->showing_for_first_time) + return meta_window_config_initial_new (); + else + return meta_window_config_new (); +}