tree: restack floaters and popups on demand
This commit is contained in:
parent
911591973e
commit
386d74f926
6 changed files with 52 additions and 6 deletions
|
|
@ -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! {
|
||||
|
|
|
|||
|
|
@ -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! {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue