From 80d58996384c73d8113d1bdba00061f411ac60d2 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Fri, 11 Oct 2024 13:26:11 -0700 Subject: [PATCH] WIP don't create initial empty workspace when there are other workspaces --- src/shell/mod.rs | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/src/shell/mod.rs b/src/shell/mod.rs index 7b8eb84f..43886c2a 100644 --- a/src/shell/mod.rs +++ b/src/shell/mod.rs @@ -419,22 +419,6 @@ impl WorkspaceSet { theme: cosmic::Theme, ) -> WorkspaceSet { let group_handle = state.create_workspace_group(); - let workspaces = { - let workspace = create_workspace( - state, - output, - &group_handle, - true, - tiling_enabled, - theme.clone(), - ); - workspace_set_idx(state, 1, idx, &workspace.handle); - state.set_workspace_capabilities( - &workspace.handle, - [WorkspaceCapabilities::Activate].into_iter(), - ); - vec![workspace] - }; let sticky_layer = FloatingLayout::new(theme.clone(), output); WorkspaceSet { @@ -446,7 +430,7 @@ impl WorkspaceSet { theme, sticky_layer, minimized_windows: Vec::new(), - workspaces, + workspaces: Vec::new(), output: output.clone(), } } @@ -697,6 +681,9 @@ impl Workspaces { for workspace in &mut moved_workspaces { move_workspace_to_group(workspace, &set.group, workspace_state); } + if set.workspaces.is_empty() { + set.add_empty_workspace(workspace_state); + } set.workspaces.extend(moved_workspaces); for (i, workspace) in set.workspaces.iter_mut().enumerate() { workspace.set_output(output);