status-area: Call AboutToShow before showing menu
Comments in `gnome-shell-extension-appindicator` indicate this is necessary for some clients. Checking the return value doesn't seem to be. There are more comments about Dropbox; more may be needed to fix it, which doesn't seem to behave very properly.
This commit is contained in:
parent
1370558546
commit
a5dfc883b8
3 changed files with 11 additions and 0 deletions
|
|
@ -150,6 +150,8 @@ impl cosmic::Application for App {
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
if self.open_menu.is_some() {
|
if self.open_menu.is_some() {
|
||||||
|
self.menus[&id].about_to_show();
|
||||||
|
|
||||||
let mut cmds = Vec::new();
|
let mut cmds = Vec::new();
|
||||||
if let Some(id) = self.popup.take() {
|
if let Some(id) = self.popup.take() {
|
||||||
cmds.push(destroy_popup(id));
|
cmds.push(destroy_popup(id));
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,13 @@ impl State {
|
||||||
pub fn subscription(&self) -> iced::Subscription<Msg> {
|
pub fn subscription(&self) -> iced::Subscription<Msg> {
|
||||||
self.item.layout_subscription().map(Msg::Layout)
|
self.item.layout_subscription().map(Msg::Layout)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn about_to_show(&self) {
|
||||||
|
let menu_proxy = self.item.menu_proxy().clone();
|
||||||
|
tokio::spawn(async move {
|
||||||
|
let _ = menu_proxy.about_to_show(0).await;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn layout_view(layout: &Layout, expanded: Option<i32>) -> cosmic::Element<Msg> {
|
fn layout_view(layout: &Layout, expanded: Option<i32>) -> cosmic::Element<Msg> {
|
||||||
|
|
|
||||||
|
|
@ -235,6 +235,8 @@ trait DBusMenu {
|
||||||
fn event(&self, id: i32, event_id: &str, data: &OwnedValue, timestamp: u32)
|
fn event(&self, id: i32, event_id: &str, data: &OwnedValue, timestamp: u32)
|
||||||
-> zbus::Result<()>;
|
-> zbus::Result<()>;
|
||||||
|
|
||||||
|
fn about_to_show(&self, id: i32) -> zbus::Result<bool>;
|
||||||
|
|
||||||
#[zbus(signal)]
|
#[zbus(signal)]
|
||||||
fn layout_updated(&self, revision: u32, parent: i32) -> zbus::Result<()>;
|
fn layout_updated(&self, revision: u32, parent: i32) -> zbus::Result<()>;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue