autocommit 2022-04-05 18:28:42 CEST
This commit is contained in:
parent
1f05ea431e
commit
a3e9f21fc5
29 changed files with 568 additions and 225 deletions
|
|
@ -78,6 +78,37 @@ impl OutputNode {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn ensure_workspace(self: &Rc<Self>) {
|
||||
if !self.workspaces.is_empty() {
|
||||
return;
|
||||
}
|
||||
let name = 'name: {
|
||||
for i in 1.. {
|
||||
let name = i.to_string();
|
||||
if !self.state.workspaces.contains(&name) {
|
||||
break 'name name;
|
||||
}
|
||||
}
|
||||
unreachable!();
|
||||
};
|
||||
let workspace = Rc::new(WorkspaceNode {
|
||||
id: self.state.node_ids.next(),
|
||||
output: CloneCell::new(self.clone()),
|
||||
position: Default::default(),
|
||||
container: Default::default(),
|
||||
stacked: Default::default(),
|
||||
seat_state: Default::default(),
|
||||
name: name.clone(),
|
||||
output_link: Default::default(),
|
||||
});
|
||||
self.state.workspaces.set(name, workspace.clone());
|
||||
workspace
|
||||
.output_link
|
||||
.set(Some(self.workspaces.add_last(workspace.clone())));
|
||||
self.show_workspace(&workspace);
|
||||
self.update_render_data();
|
||||
}
|
||||
|
||||
pub fn show_workspace(&self, ws: &Rc<WorkspaceNode>) {
|
||||
self.workspace.set(Some(ws.clone()));
|
||||
ws.clone().change_extents(&self.workspace_rect());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue