tree: update outputs of surfaces when moving a workspace
This commit is contained in:
parent
0ada595bb9
commit
259340938b
2 changed files with 14 additions and 9 deletions
|
|
@ -210,7 +210,6 @@ impl ConnectorHandler {
|
|||
}
|
||||
global.node.set(None);
|
||||
global.destroyed.set(true);
|
||||
let _ = self.state.remove_global(&*global);
|
||||
self.state.root.outputs.remove(&self.id);
|
||||
self.data.connected.set(false);
|
||||
self.state.outputs.remove(&self.id);
|
||||
|
|
@ -252,5 +251,6 @@ impl ConnectorHandler {
|
|||
dev.connectors.remove(&self.id);
|
||||
}
|
||||
self.state.remove_output_scale(on.preferred_scale.get());
|
||||
let _ = self.state.remove_global(&*global);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,13 +4,14 @@ use {
|
|||
ifs::{
|
||||
wl_output::OutputId,
|
||||
wl_seat::{NodeSeatState, WlSeatGlobal},
|
||||
wl_surface::SurfaceSendPreferredScaleVisitor,
|
||||
wl_surface::WlSurface,
|
||||
},
|
||||
rect::Rect,
|
||||
render::Renderer,
|
||||
tree::{
|
||||
container::ContainerNode, walker::NodeVisitor, ContainingNode, Direction,
|
||||
FindTreeResult, FoundNode, Node, NodeId, OutputNode, StackedNode, ToplevelNode,
|
||||
FindTreeResult, FoundNode, Node, NodeId, NodeVisitorBase, OutputNode, StackedNode,
|
||||
ToplevelNode,
|
||||
},
|
||||
utils::{
|
||||
clonecell::CloneCell,
|
||||
|
|
@ -46,14 +47,18 @@ impl WorkspaceNode {
|
|||
}
|
||||
|
||||
pub fn set_output(&self, output: &Rc<OutputNode>) {
|
||||
let old = self.output.set(output.clone());
|
||||
if old.preferred_scale.get() != output.preferred_scale.get() {
|
||||
let mut visitor = SurfaceSendPreferredScaleVisitor(output.preferred_scale.get());
|
||||
self.node_visit_children(&mut visitor);
|
||||
for stacked in self.stacked.iter() {
|
||||
stacked.deref().clone().node_visit(&mut visitor);
|
||||
self.output.set(output.clone());
|
||||
struct OutputSetter<'a>(&'a Rc<OutputNode>);
|
||||
impl NodeVisitorBase for OutputSetter<'_> {
|
||||
fn visit_surface(&mut self, node: &Rc<WlSurface>) {
|
||||
node.set_output(self.0);
|
||||
}
|
||||
}
|
||||
let mut visitor = OutputSetter(output);
|
||||
self.node_visit_children(&mut visitor);
|
||||
for stacked in self.stacked.iter() {
|
||||
stacked.deref().clone().node_visit(&mut visitor);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_container(self: &Rc<Self>, container: &Rc<ContainerNode>) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue