Merge pull request #470 from mahkoh/jorth/popup-visible
tree: don't make xdg-popup visible if parent is not visible
This commit is contained in:
commit
956d3f79f7
4 changed files with 20 additions and 0 deletions
|
|
@ -208,6 +208,10 @@ impl<T: TrayItem> XdgPopupParent for Popup<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn visible(&self) -> bool {
|
||||||
|
self.parent.node_visible()
|
||||||
|
}
|
||||||
|
|
||||||
fn tray_item(&self) -> Option<TrayItemId> {
|
fn tray_item(&self) -> Option<TrayItemId> {
|
||||||
Some(self.parent.data().tray_item_id)
|
Some(self.parent.data().tray_item_id)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -140,6 +140,10 @@ impl XdgPopupParent for Popup {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn visible(&self) -> bool {
|
||||||
|
self.parent.surface.visible.get()
|
||||||
|
}
|
||||||
|
|
||||||
fn tray_item(&self) -> Option<TrayItemId> {
|
fn tray_item(&self) -> Option<TrayItemId> {
|
||||||
self.parent.clone().tray_item()
|
self.parent.clone().tray_item()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@ pub trait XdgPopupParent {
|
||||||
fn output(&self) -> Rc<OutputNode>;
|
fn output(&self) -> Rc<OutputNode>;
|
||||||
fn has_workspace_link(&self) -> bool;
|
fn has_workspace_link(&self) -> bool;
|
||||||
fn post_commit(&self);
|
fn post_commit(&self);
|
||||||
|
fn visible(&self) -> bool;
|
||||||
fn tray_item(&self) -> Option<TrayItemId> {
|
fn tray_item(&self) -> Option<TrayItemId> {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
@ -369,6 +370,13 @@ impl StackedNode for XdgPopup {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn stacked_set_visible(&self, visible: bool) {
|
fn stacked_set_visible(&self, visible: bool) {
|
||||||
|
if visible {
|
||||||
|
if let Some(parent) = self.parent.get() {
|
||||||
|
if !parent.visible() {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
self.set_visible(visible);
|
self.set_visible(visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -715,6 +715,10 @@ impl XdgPopupParent for Popup {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn visible(&self) -> bool {
|
||||||
|
self.parent.node_visible()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
object_base! {
|
object_base! {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue