autocommit 2022-04-24 17:15:41 CEST
This commit is contained in:
parent
025efbaccc
commit
cff35fd7da
5 changed files with 63 additions and 23 deletions
|
|
@ -199,7 +199,38 @@ impl WlSeatGlobal {
|
|||
self.output.get()
|
||||
}
|
||||
|
||||
pub fn set_workspace(&self, _ws: &Rc<WorkspaceNode>) {}
|
||||
pub fn set_workspace(&self, ws: &Rc<WorkspaceNode>) {
|
||||
let tl = match self.keyboard_node.get().node_toplevel() {
|
||||
Some(tl) => tl,
|
||||
_ => return,
|
||||
};
|
||||
if tl.tl_data().is_fullscreen.get() {
|
||||
return;
|
||||
}
|
||||
let old_ws = match tl.tl_data().workspace.get() {
|
||||
Some(ws) => ws,
|
||||
_ => return,
|
||||
};
|
||||
if old_ws.id == ws.id {
|
||||
return;
|
||||
}
|
||||
let cn = match tl.tl_data().parent.get().and_then(|p| p.node_into_containing_node()) {
|
||||
Some(cn) => cn,
|
||||
_ => return,
|
||||
};
|
||||
let kb_foci = collect_kb_foci(tl.clone().tl_into_node());
|
||||
cn.cnode_remove_child2(tl.tl_as_node(), true);
|
||||
if !ws.visible.get() {
|
||||
for focus in kb_foci {
|
||||
old_ws.clone().node_do_focus(&focus, Direction::Unspecified);
|
||||
}
|
||||
}
|
||||
if tl.tl_data().is_floating.get() {
|
||||
self.state.map_floating(tl.clone(), tl.tl_data().float_width.get(), tl.tl_data().float_height.get(), ws);
|
||||
} else {
|
||||
self.state.map_tiled_on(tl, ws);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn mark_last_active(self: &Rc<Self>) {
|
||||
self.queue_link
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue