fix: clear popup state when it is dismissed by the compositor

This commit is contained in:
Ashley Wulber 2023-09-12 14:29:34 -04:00 • committed by Ashley Wulber
parent f4cc4cecd0
commit 56d96e5282
8 changed files with 75 additions and 0 deletions

View file

@ -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(