dbus: Add methods to show or hide
This commit is contained in:
parent
c9a69bdfdb
commit
b8780b9911
4 changed files with 66 additions and 4 deletions
10
src/main.rs
10
src/main.rs
|
|
@ -116,6 +116,7 @@ enum Msg {
|
|||
TogglePinned(ExtWorkspaceHandleV1),
|
||||
EnteredWorkspaceSidebarEntry(ExtWorkspaceHandleV1, bool),
|
||||
DbusInterface(zbus::Result<dbus::Interface>),
|
||||
DBus(dbus::Event),
|
||||
Ignore,
|
||||
}
|
||||
|
||||
|
|
@ -728,6 +729,12 @@ impl Application for App {
|
|||
self.dbus_interface = Some(interface);
|
||||
}
|
||||
}
|
||||
Msg::DBus(evt) => {
|
||||
return match evt {
|
||||
dbus::Event::Show => self.show(),
|
||||
dbus::Event::Hide => self.hide(),
|
||||
};
|
||||
}
|
||||
Msg::Ignore => {}
|
||||
}
|
||||
|
||||
|
|
@ -812,6 +819,9 @@ impl Application for App {
|
|||
if let Some(conn) = self.conn.clone() {
|
||||
subscriptions.push(backend::subscription(conn).map(Msg::Wayland));
|
||||
}
|
||||
if let Some(interface) = &self.dbus_interface {
|
||||
subscriptions.push(interface.subscription().map(Msg::DBus));
|
||||
}
|
||||
iced::Subscription::batch(subscriptions)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue