From 158e2e64b7fe584ea8fe782e4608df25d6103fc3 Mon Sep 17 00:00:00 2001 From: Victor Kareh Date: Wed, 30 Jul 2025 06:45:30 -0400 Subject: Add dynamic workspaces support Adds GNOME3-style dynamic workspace management. Workspaces are created when no empty ones exist and removed when multiple empty workspaces are present, maintaining exactly one empty workspace at the end. Fixes #406 --- src/core/workspace.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/core/workspace.c') diff --git a/src/core/workspace.c b/src/core/workspace.c index 3b640cd1..556899e8 100644 --- a/src/core/workspace.c +++ b/src/core/workspace.c @@ -27,6 +27,7 @@ #include "workspace.h" #include "errors.h" #include "prefs.h" +#include "screen-private.h" #include #include #include @@ -217,6 +218,9 @@ meta_workspace_add_window (MetaWorkspace *workspace, * the relevant struts */ meta_window_queue (window, META_QUEUE_CALC_SHOWING|META_QUEUE_MOVE_RESIZE); + + /* Update dynamic workspaces (this will add a new workspace if necessary) */ + meta_screen_update_dynamic_workspaces (workspace->screen); } void @@ -263,6 +267,9 @@ meta_workspace_remove_window (MetaWorkspace *workspace, * the relevant struts */ meta_window_queue (window, META_QUEUE_CALC_SHOWING|META_QUEUE_MOVE_RESIZE); + + /* Update dynamic workspaces (this will remove an empty workspace if necessary) */ + meta_screen_update_dynamic_workspaces (workspace->screen); } void -- cgit v1.2.1