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/prefs.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/core/prefs.c') diff --git a/src/core/prefs.c b/src/core/prefs.c index 844b1a06..23ed5d45 100644 --- a/src/core/prefs.c +++ b/src/core/prefs.c @@ -105,6 +105,7 @@ static gboolean raise_on_click = TRUE; static gboolean attach_modal_dialogs = FALSE; static char* current_theme = NULL; static int num_workspaces = 4; +static gboolean dynamic_workspaces = FALSE; static MetaWrapStyle wrap_style = META_WRAP_NONE; static MetaActionTitlebar action_double_click_titlebar = META_ACTION_TITLEBAR_TOGGLE_MAXIMIZE; static MetaActionTitlebar action_middle_click_titlebar = META_ACTION_TITLEBAR_LOWER; @@ -376,6 +377,12 @@ static MetaBoolPreference preferences_bool[] = NULL, /* feature is known but disabled */ FALSE, }, + { "dynamic-workspaces", + KEY_GENERAL_SCHEMA, + META_PREF_DYNAMIC_WORKSPACES, + &dynamic_workspaces, + FALSE, + }, { "disable-workarounds", KEY_GENERAL_SCHEMA, META_PREF_DISABLE_WORKAROUNDS, @@ -1583,6 +1590,12 @@ meta_prefs_get_num_workspaces (void) return num_workspaces; } +gboolean +meta_prefs_get_dynamic_workspaces (void) +{ + return dynamic_workspaces; +} + MetaWrapStyle meta_prefs_get_wrap_style (void) { @@ -1636,6 +1649,9 @@ meta_preference_to_string (MetaPreference pref) case META_PREF_NUM_WORKSPACES: return "NUM_WORKSPACES"; + case META_PREF_DYNAMIC_WORKSPACES: + return "DYNAMIC_WORKSPACES"; + case META_PREF_WRAP_STYLE: return "WRAP_STYLE"; -- cgit v1.2.1