feat(wm): ensure workspace count

Allow the number of workspaces for a given monitor to be pre-created, so
that configuration options can be sent (name, padding, layout) before
the workspace has ever been activated.
This commit is contained in:
LGUG2Z
2021-07-30 12:06:29 -07:00
parent d8a717950c
commit 8c939328d1
5 changed files with 48 additions and 7 deletions

View File

@@ -53,6 +53,13 @@ impl Monitor {
Ok(())
}
pub fn ensure_workspace_count(&mut self, ensure_count: usize) {
if self.workspaces().len() < ensure_count {
self.workspaces_mut()
.resize(ensure_count, Workspace::default());
}
}
pub fn move_container_to_workspace(
&mut self,
target_workspace_idx: usize,