1
0
Fork 0
forked from wry/wry

tree: add Node::node_make_visible

This commit is contained in:
Julian Orth 2025-07-18 20:01:27 +02:00
parent 289c201a69
commit 4bfa9fb7fc
15 changed files with 147 additions and 34 deletions

View file

@ -45,6 +45,7 @@ pub trait XdgPopupParent {
fn has_workspace_link(&self) -> bool;
fn post_commit(&self);
fn visible(&self) -> bool;
fn make_visible(self: Rc<Self>);
fn tray_item(&self) -> Option<TrayItemId> {
None
}
@ -344,6 +345,12 @@ impl Node for XdgPopup {
Some(self.xdg.surface.client.clone())
}
fn node_make_visible(self: Rc<Self>) {
if let Some(parent) = self.parent.get() {
parent.make_visible();
}
}
fn node_on_pointer_enter(self: Rc<Self>, seat: &Rc<WlSeatGlobal>, _x: Fixed, _y: Fixed) {
seat.enter_popup(&self);
}
@ -430,6 +437,10 @@ impl XdgSurfaceExt for XdgPopup {
fn tray_item(&self) -> Option<TrayItemId> {
self.parent.get()?.tray_item()
}
fn make_visible(self: Rc<Self>) {
self.node_make_visible();
}
}
#[derive(Debug, Error)]

View file

@ -610,6 +610,10 @@ impl Node for XdgToplevel {
Some(self)
}
fn node_make_visible(self: Rc<Self>) {
self.toplevel_data.make_visible(&*self)
}
fn node_on_pointer_enter(self: Rc<Self>, seat: &Rc<WlSeatGlobal>, _x: Fixed, _y: Fixed) {
seat.enter_toplevel(self.clone());
}
@ -780,6 +784,10 @@ impl XdgSurfaceExt for XdgToplevel {
.state
.damage(self.node_absolute_position());
}
fn make_visible(self: Rc<Self>) {
self.node_make_visible();
}
}
#[derive(Debug, Error)]