App: Make sure to quit on delete event.
Since 9a76c6428a I've noticed
the applciation does not quit properly, and then it's unable
to be launched again till it's killed manually.
This patch is an attept to correct/workaroud that by calling
explcitly gio::ApplicationExt::quit().
This commit is contained in:
parent
c27f5ec02e
commit
4fa973007d
@ -87,10 +87,24 @@ impl App {
|
||||
window.set_title("Podcasts");
|
||||
|
||||
let weak_s = settings.downgrade();
|
||||
let weak_app = application.downgrade();
|
||||
window.connect_delete_event(move |window, _| {
|
||||
weak_s
|
||||
.upgrade()
|
||||
.map(|settings| WindowGeometry::from_window(&window).write(&settings));
|
||||
let app = match weak_app.upgrade() {
|
||||
Some(a) => a,
|
||||
None => return Inhibit(false),
|
||||
};
|
||||
|
||||
let settings = match weak_s.upgrade() {
|
||||
Some(s) => s,
|
||||
None => return Inhibit(false),
|
||||
};
|
||||
|
||||
info!("Savign window position");
|
||||
WindowGeometry::from_window(&window).write(&settings);
|
||||
|
||||
info!("Application is exiting");
|
||||
app.quit();
|
||||
|
||||
Inhibit(false)
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user