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.node.set(None);
|
||||||
global.destroyed.set(true);
|
global.destroyed.set(true);
|
||||||
let _ = self.state.remove_global(&*global);
|
|
||||||
self.state.root.outputs.remove(&self.id);
|
self.state.root.outputs.remove(&self.id);
|
||||||
self.data.connected.set(false);
|
self.data.connected.set(false);
|
||||||
self.state.outputs.remove(&self.id);
|
self.state.outputs.remove(&self.id);
|
||||||
|
|
@ -252,5 +251,6 @@ impl ConnectorHandler {
|
||||||
dev.connectors.remove(&self.id);
|
dev.connectors.remove(&self.id);
|
||||||
}
|
}
|
||||||
self.state.remove_output_scale(on.preferred_scale.get());
|
self.state.remove_output_scale(on.preferred_scale.get());
|
||||||
|
let _ = self.state.remove_global(&*global);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,13 +4,14 @@ use {
|
||||||
ifs::{
|
ifs::{
|
||||||
wl_output::OutputId,
|
wl_output::OutputId,
|
||||||
wl_seat::{NodeSeatState, WlSeatGlobal},
|
wl_seat::{NodeSeatState, WlSeatGlobal},
|
||||||
wl_surface::SurfaceSendPreferredScaleVisitor,
|
wl_surface::WlSurface,
|
||||||
},
|
},
|
||||||
rect::Rect,
|
rect::Rect,
|
||||||
render::Renderer,
|
render::Renderer,
|
||||||
tree::{
|
tree::{
|
||||||
container::ContainerNode, walker::NodeVisitor, ContainingNode, Direction,
|
container::ContainerNode, walker::NodeVisitor, ContainingNode, Direction,
|
||||||
FindTreeResult, FoundNode, Node, NodeId, OutputNode, StackedNode, ToplevelNode,
|
FindTreeResult, FoundNode, Node, NodeId, NodeVisitorBase, OutputNode, StackedNode,
|
||||||
|
ToplevelNode,
|
||||||
},
|
},
|
||||||
utils::{
|
utils::{
|
||||||
clonecell::CloneCell,
|
clonecell::CloneCell,
|
||||||
|
|
@ -46,15 +47,19 @@ impl WorkspaceNode {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_output(&self, output: &Rc<OutputNode>) {
|
pub fn set_output(&self, output: &Rc<OutputNode>) {
|
||||||
let old = self.output.set(output.clone());
|
self.output.set(output.clone());
|
||||||
if old.preferred_scale.get() != output.preferred_scale.get() {
|
struct OutputSetter<'a>(&'a Rc<OutputNode>);
|
||||||
let mut visitor = SurfaceSendPreferredScaleVisitor(output.preferred_scale.get());
|
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);
|
self.node_visit_children(&mut visitor);
|
||||||
for stacked in self.stacked.iter() {
|
for stacked in self.stacked.iter() {
|
||||||
stacked.deref().clone().node_visit(&mut visitor);
|
stacked.deref().clone().node_visit(&mut visitor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
pub fn set_container(self: &Rc<Self>, container: &Rc<ContainerNode>) {
|
pub fn set_container(self: &Rc<Self>, container: &Rc<ContainerNode>) {
|
||||||
let pos = self.position.get();
|
let pos = self.position.get();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue