Don't create initial empty workspace when there are other workspaces
`WorkspaceSet::new()` now creates a set with no workspaces, instead of one with a single workspace.
This commit is contained in:
parent
229c794aad
commit
2497992d31
1 changed files with 4 additions and 17 deletions
|
|
@ -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(),
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue