1
0
Fork 0
forked from wry/wry

autocommit 2022-04-08 00:04:55 CEST

This commit is contained in:
Julian Orth 2022-04-08 00:04:55 +02:00
parent 26f8c1aeb6
commit 0bd9a70e69
10 changed files with 35 additions and 12 deletions

View file

@ -1,3 +1,4 @@
use std::cell::Cell;
use {
crate::{
backend::Mode,
@ -106,6 +107,7 @@ impl OutputNode {
seat_state: Default::default(),
name: name.clone(),
output_link: Default::default(),
visible: Cell::new(false),
});
self.state.workspaces.set(name, workspace.clone());
workspace
@ -117,7 +119,12 @@ impl OutputNode {
}
pub fn show_workspace(&self, ws: &Rc<WorkspaceNode>) {
self.workspace.set(Some(ws.clone()));
ws.visible.set(true);
if let Some(old) = self.workspace.set(Some(ws.clone())) {
if old.id != ws.id {
old.visible.set(false);
}
}
ws.clone().change_extents(&self.workspace_rect());
}

View file

@ -27,6 +27,7 @@ pub struct WorkspaceNode {
pub seat_state: NodeSeatState,
pub name: String,
pub output_link: Cell<Option<LinkedNode<Rc<WorkspaceNode>>>>,
pub visible: Cell<bool>,
}
impl WorkspaceNode {