fix: clear popup state when it is dismissed by the compositor
This commit is contained in:
parent
f4cc4cecd0
commit
56d96e5282
8 changed files with 75 additions and 0 deletions
|
|
@ -124,6 +124,7 @@ enum Message {
|
|||
InputChanged(String),
|
||||
Pulse(pulse::Event),
|
||||
TogglePopup,
|
||||
CloseRequested(window::Id),
|
||||
ToggleMediaControlsInTopPanel(chain::Toggler, bool),
|
||||
Frame(Instant),
|
||||
}
|
||||
|
|
@ -317,6 +318,11 @@ impl cosmic::Application for Audio {
|
|||
self.timeline.set_chain(chain).start();
|
||||
self.show_media_controls_in_top_panel = enabled;
|
||||
}
|
||||
Message::CloseRequested(id) => {
|
||||
if Some(id) == self.popup {
|
||||
self.popup = None;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Command::none()
|
||||
|
|
@ -462,6 +468,10 @@ impl cosmic::Application for Audio {
|
|||
.popup_container(container(content))
|
||||
.into()
|
||||
}
|
||||
|
||||
fn on_close_requested(&self, id: window::Id) -> Option<Message> {
|
||||
Some(Message::CloseRequested(id))
|
||||
}
|
||||
}
|
||||
|
||||
fn revealer(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue