tree: fix some issues with toplevel visibility handling
This commit is contained in:
parent
d725a1eac2
commit
0628a9d393
3 changed files with 9 additions and 8 deletions
|
|
@ -131,7 +131,6 @@ pub struct XwindowData {
|
||||||
tree_id!(XwindowId);
|
tree_id!(XwindowId);
|
||||||
pub struct Xwindow {
|
pub struct Xwindow {
|
||||||
pub id: XwindowId,
|
pub id: XwindowId,
|
||||||
pub seat_state: NodeSeatState,
|
|
||||||
pub data: Rc<XwindowData>,
|
pub data: Rc<XwindowData>,
|
||||||
pub x: Rc<XSurface>,
|
pub x: Rc<XSurface>,
|
||||||
pub display_link: RefCell<Option<LinkedNode<Rc<dyn StackedNode>>>>,
|
pub display_link: RefCell<Option<LinkedNode<Rc<dyn StackedNode>>>>,
|
||||||
|
|
@ -214,7 +213,6 @@ impl Xwindow {
|
||||||
tld.pos.set(surface.extents.get());
|
tld.pos.set(surface.extents.get());
|
||||||
let slf = Rc::new(Self {
|
let slf = Rc::new(Self {
|
||||||
id: data.state.node_ids.next(),
|
id: data.state.node_ids.next(),
|
||||||
seat_state: Default::default(),
|
|
||||||
data: data.clone(),
|
data: data.clone(),
|
||||||
display_link: Default::default(),
|
display_link: Default::default(),
|
||||||
toplevel_data: tld,
|
toplevel_data: tld,
|
||||||
|
|
@ -298,7 +296,7 @@ impl Node for Xwindow {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn node_seat_state(&self) -> &NodeSeatState {
|
fn node_seat_state(&self) -> &NodeSeatState {
|
||||||
&self.seat_state
|
&self.toplevel_data.seat_state
|
||||||
}
|
}
|
||||||
|
|
||||||
fn node_visit(self: Rc<Self>, visitor: &mut dyn NodeVisitor) {
|
fn node_visit(self: Rc<Self>, visitor: &mut dyn NodeVisitor) {
|
||||||
|
|
@ -422,7 +420,7 @@ impl ToplevelNode for Xwindow {
|
||||||
|
|
||||||
fn tl_set_visible(&self, visible: bool) {
|
fn tl_set_visible(&self, visible: bool) {
|
||||||
self.x.surface.set_visible(visible);
|
self.x.surface.set_visible(visible);
|
||||||
self.seat_state.set_visible(self, visible);
|
self.toplevel_data.set_visible(self, visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn tl_destroy(&self) {
|
fn tl_destroy(&self) {
|
||||||
|
|
|
||||||
|
|
@ -1429,9 +1429,12 @@ impl ToplevelNode for ContainerNode {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn tl_set_visible(&self, visible: bool) {
|
fn tl_set_visible(&self, visible: bool) {
|
||||||
self.toplevel_data.visible.set(visible);
|
if let Some(mc) = self.mono_child.get() {
|
||||||
for child in self.children.iter() {
|
mc.node.tl_set_visible(visible);
|
||||||
child.node.tl_set_visible(visible);
|
} else {
|
||||||
|
for child in self.children.iter() {
|
||||||
|
child.node.tl_set_visible(visible);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
self.toplevel_data.set_visible(self, visible);
|
self.toplevel_data.set_visible(self, visible);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,7 @@ impl ToplevelNode for PlaceholderNode {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn tl_set_visible(&self, visible: bool) {
|
fn tl_set_visible(&self, visible: bool) {
|
||||||
self.toplevel.visible.set(visible);
|
self.toplevel.set_visible(self, visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn tl_destroy(&self) {
|
fn tl_destroy(&self) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue