gtk: handle exit of service properly

This commit is contained in:
Ferdinand Schober
2024-01-23 21:35:31 +01:00
parent 82926d8272
commit 1f4821a16d
3 changed files with 22 additions and 3 deletions

View File

@@ -129,7 +129,14 @@ fn build_ui(app: &Application) {
window.imp().stream.borrow_mut().replace(tx);
glib::spawn_future_local(clone!(@weak window => async move {
loop {
let notify = receiver.recv().await.unwrap();
let notify = receiver.recv().await;
let notify = match notify {
Ok(n) => n,
_ => {
window.show_exit_dialog("service exited");
break;
}
};
match notify {
FrontendNotify::NotifyClientActivate(handle, active) => {
window.activate_client(handle, active);