Skip to content

Commit

Permalink
Don't create initial empty workspace when there are other workspaces
Browse files Browse the repository at this point in the history
`WorkspaceSet::new()` now creates a set with no workspaces, instead of
one with a single workspace.
  • Loading branch information
ids1024 authored and Drakulix committed Oct 21, 2024
1 parent 229c794 commit 2497992
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 @@ -698,6 +682,9 @@ impl Workspaces {
move_workspace_to_group(workspace, &set.group, workspace_state);
}
set.workspaces.extend(moved_workspaces);
if set.workspaces.is_empty() {
set.add_empty_workspace(workspace_state);
}
for (i, workspace) in set.workspaces.iter_mut().enumerate() {
workspace.set_output(output);
workspace.refresh(xdg_activation_state);
Expand Down

0 comments on commit 2497992

Please sign in to comment.