xdg_surface: fix nested popups that are not attached to a workspace
This commit is contained in:
parent
d95a2d2f2e
commit
a2eb810e9d
1 changed files with 11 additions and 9 deletions
|
|
@ -105,25 +105,27 @@ impl XdgPopupParent for Popup {
|
||||||
fn post_commit(&self) {
|
fn post_commit(&self) {
|
||||||
let mut wl = self.workspace_link.borrow_mut();
|
let mut wl = self.workspace_link.borrow_mut();
|
||||||
let mut dl = self.display_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 surface = &self.popup.xdg.surface;
|
||||||
let state = &surface.client.state;
|
let state = &surface.client.state;
|
||||||
if surface.buffer.is_some() {
|
if surface.buffer.is_some() {
|
||||||
|
let mut any_set = false;
|
||||||
if wl.is_none() {
|
if wl.is_none() {
|
||||||
self.popup.xdg.set_workspace(&ws);
|
if let Some(ws) = self.parent.workspace.get() {
|
||||||
*wl = Some(ws.stacked.add_last(self.popup.clone()));
|
self.popup.xdg.set_workspace(&ws);
|
||||||
|
*wl = Some(ws.stacked.add_last(self.popup.clone()));
|
||||||
|
any_set = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if dl.is_none() {
|
||||||
*dl = Some(
|
*dl = Some(
|
||||||
self.parent
|
self.parent
|
||||||
.popup_display_stack
|
.popup_display_stack
|
||||||
.get()
|
.get()
|
||||||
.add_last(self.popup.clone()),
|
.add_last(self.popup.clone()),
|
||||||
);
|
);
|
||||||
|
any_set = true;
|
||||||
|
}
|
||||||
|
if any_set {
|
||||||
state.tree_changed();
|
state.tree_changed();
|
||||||
self.popup.set_visible(self.parent.surface.visible.get());
|
self.popup.set_visible(self.parent.surface.visible.get());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue