Skip to content

Commit

Permalink
WIP don't create initial empty workspace when there are other workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
ids1024 committed Oct 11, 2024
1 parent 5e0da8e commit 80d5899
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions src/shell/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -446,7 +430,7 @@ impl WorkspaceSet {
theme,
sticky_layer,
minimized_windows: Vec::new(),
workspaces,
workspaces: Vec::new(),
output: output.clone(),
}
}
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 80d5899

Please sign in to comment.