1
0
Fork 0
forked from wry/wry

xdg_surface: fix nested popups that are not attached to a workspace

This commit is contained in:
Julian Orth 2024-10-17 16:05:07 +02:00
parent d95a2d2f2e
commit a2eb810e9d

View file

@ -105,25 +105,27 @@ impl XdgPopupParent for Popup {
fn post_commit(&self) {
let mut wl = self.workspace_link.borrow_mut();
let mut dl = self.display_link.borrow_mut();
let ws = match self.parent.workspace.get() {
Some(ws) => ws,
_ => {
log::info!("no ws");
return;
}
};
let surface = &self.popup.xdg.surface;
let state = &surface.client.state;
if surface.buffer.is_some() {
let mut any_set = false;
if wl.is_none() {
self.popup.xdg.set_workspace(&ws);
*wl = Some(ws.stacked.add_last(self.popup.clone()));
if let Some(ws) = self.parent.workspace.get() {
self.popup.xdg.set_workspace(&ws);
*wl = Some(ws.stacked.add_last(self.popup.clone()));
any_set = true;
}
}
if dl.is_none() {
*dl = Some(
self.parent
.popup_display_stack
.get()
.add_last(self.popup.clone()),
);
any_set = true;
}
if any_set {
state.tree_changed();
self.popup.set_visible(self.parent.surface.visible.get());
}