seperate workspaces by monitor
This commit is contained in:
parent
c555593ae2
commit
a29937ebe8
5 changed files with 44 additions and 20 deletions
|
|
@ -677,7 +677,7 @@ impl OutputNode {
|
|||
let name = 'name: {
|
||||
for i in 1.. {
|
||||
let name = i.to_string();
|
||||
if !self.state.workspaces.contains(&name) {
|
||||
if self.find_workspace(&name).is_none() {
|
||||
break 'name name;
|
||||
}
|
||||
}
|
||||
|
|
@ -686,6 +686,13 @@ impl OutputNode {
|
|||
self.create_workspace(&name)
|
||||
}
|
||||
|
||||
pub fn find_workspace(&self, name: &str) -> Option<Rc<WorkspaceNode>> {
|
||||
self.workspaces
|
||||
.iter()
|
||||
.find(|ws| ws.name.as_str() == name)
|
||||
.map(|ws| (*ws).clone())
|
||||
}
|
||||
|
||||
pub fn show_workspace(&self, ws: &Rc<WorkspaceNode>) -> bool {
|
||||
let mut seats = SmallVec::new();
|
||||
if let Some(old) = self.workspace.set(Some(ws.clone())) {
|
||||
|
|
@ -705,7 +712,7 @@ impl OutputNode {
|
|||
wh.handle_destroyed();
|
||||
}
|
||||
old.clear();
|
||||
self.state.workspaces.remove(&old.name);
|
||||
self.state.workspaces.remove(&old.id);
|
||||
} else {
|
||||
old.set_visible(false);
|
||||
old.flush_jay_workspaces();
|
||||
|
|
@ -747,7 +754,7 @@ impl OutputNode {
|
|||
self.workspaces.add_last(ws.clone())
|
||||
};
|
||||
*ws.output_link.borrow_mut() = Some(link);
|
||||
self.state.workspaces.set(name.to_string(), ws.clone());
|
||||
self.state.workspaces.set(ws.id, ws.clone());
|
||||
if self.workspace.is_none() {
|
||||
self.show_workspace(&ws);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue