summaryrefslogtreecommitdiff
path: root/src/core/prefs.c
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2025-07-30 06:45:30 -0400
committerVictor Kareh <[email protected]>2025-10-06 12:04:32 +0000
commit158e2e64b7fe584ea8fe782e4608df25d6103fc3 (patch)
tree6a0d865c9c36d9acc80d401fcaf9fb141f0b9a53 /src/core/prefs.c
parentee2adf9fcbe03f2b7d0afd62cefe0b77784f618a (diff)
downloadmarco-158e2e64b7fe584ea8fe782e4608df25d6103fc3.tar.bz2
marco-158e2e64b7fe584ea8fe782e4608df25d6103fc3.tar.xz
Add dynamic workspaces supportHEADmaster
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
Diffstat (limited to 'src/core/prefs.c')
-rw-r--r--src/core/prefs.c16
1 files changed, 16 insertions, 0 deletions
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";