1
0
Fork 0
forked from wry/wry

tree: restack floaters and popups on demand

This commit is contained in:
Julian Orth 2024-03-03 15:39:04 +01:00
parent 911591973e
commit 386d74f926
6 changed files with 52 additions and 6 deletions

View file

@ -328,6 +328,12 @@ impl XdgSurface {
popup.set_visible(visible);
}
}
fn restack_popups(&self) {
for popup in self.popups.lock().values() {
popup.restack();
}
}
}
object_base! {

View file

@ -259,6 +259,16 @@ impl XdgPopup {
self.xdg.detach_node();
self.seat_state.destroy_node(self);
}
pub fn restack(&self) {
let state = &self.xdg.surface.client.state;
let dl = self.display_link.borrow();
if let Some(dl) = &*dl {
state.root.stacked.add_last_existing(dl);
}
self.xdg.restack_popups();
state.tree_changed();
}
}
object_base! {

View file

@ -634,6 +634,10 @@ impl ToplevelNodeBase for XdgToplevel {
fn tl_scanout_surface(&self) -> Option<Rc<WlSurface>> {
Some(self.xdg.surface.clone())
}
fn tl_restack_popups(&self) {
self.xdg.restack_popups();
}
}
impl XdgSurfaceExt for XdgToplevel {