tree: restore workspaces after monitor reconnect
This commit is contained in:
parent
eaa3b85a97
commit
7476e6f2d9
6 changed files with 80 additions and 9 deletions
|
|
@ -168,6 +168,7 @@ impl OutputNode {
|
|||
};
|
||||
let workspace = Rc::new(WorkspaceNode {
|
||||
id: self.state.node_ids.next(),
|
||||
is_dummy: false,
|
||||
output: CloneCell::new(self.clone()),
|
||||
position: Default::default(),
|
||||
container: Default::default(),
|
||||
|
|
@ -177,6 +178,8 @@ impl OutputNode {
|
|||
output_link: Default::default(),
|
||||
visible: Cell::new(true),
|
||||
fullscreen: Default::default(),
|
||||
visible_on_desired_output: Cell::new(false),
|
||||
desired_output: CloneCell::new(self.global.output_id.clone()),
|
||||
});
|
||||
self.state.workspaces.set(name, workspace.clone());
|
||||
workspace
|
||||
|
|
@ -214,6 +217,7 @@ impl OutputNode {
|
|||
pub fn create_workspace(self: &Rc<Self>, name: &str) -> Rc<WorkspaceNode> {
|
||||
let ws = Rc::new(WorkspaceNode {
|
||||
id: self.state.node_ids.next(),
|
||||
is_dummy: false,
|
||||
output: CloneCell::new(self.clone()),
|
||||
position: Cell::new(Default::default()),
|
||||
container: Default::default(),
|
||||
|
|
@ -223,6 +227,8 @@ impl OutputNode {
|
|||
output_link: Cell::new(None),
|
||||
visible: Cell::new(false),
|
||||
fullscreen: Default::default(),
|
||||
visible_on_desired_output: Cell::new(false),
|
||||
desired_output: CloneCell::new(self.global.output_id.clone()),
|
||||
});
|
||||
ws.output_link
|
||||
.set(Some(self.workspaces.add_last(ws.clone())));
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
use {
|
||||
crate::{
|
||||
cursor::KnownCursor,
|
||||
ifs::wl_seat::{NodeSeatState, WlSeatGlobal},
|
||||
ifs::{
|
||||
wl_output::OutputId,
|
||||
wl_seat::{NodeSeatState, WlSeatGlobal},
|
||||
},
|
||||
rect::Rect,
|
||||
render::Renderer,
|
||||
tree::{
|
||||
|
|
@ -20,6 +23,7 @@ tree_id!(WorkspaceNodeId);
|
|||
|
||||
pub struct WorkspaceNode {
|
||||
pub id: WorkspaceNodeId,
|
||||
pub is_dummy: bool,
|
||||
pub output: CloneCell<Rc<OutputNode>>,
|
||||
pub position: Cell<Rect>,
|
||||
pub container: CloneCell<Option<Rc<ContainerNode>>>,
|
||||
|
|
@ -29,6 +33,8 @@ pub struct WorkspaceNode {
|
|||
pub output_link: Cell<Option<LinkedNode<Rc<WorkspaceNode>>>>,
|
||||
pub visible: Cell<bool>,
|
||||
pub fullscreen: CloneCell<Option<Rc<dyn ToplevelNode>>>,
|
||||
pub visible_on_desired_output: Cell<bool>,
|
||||
pub desired_output: CloneCell<Rc<OutputId>>,
|
||||
}
|
||||
|
||||
impl WorkspaceNode {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue