linux: quit after the last window is closed (#7602)

Release Notes:
- N/A
This commit is contained in:
Dzmitry Malyshau 2024-02-08 21:41:15 -08:00 committed by GitHub
parent 91c699aeaa
commit 0ab1094f0c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -125,11 +125,8 @@ impl Platform for LinuxPlatform {
// window "x" button clicked by user, we gracefully exit
let window = self.state.lock().windows.remove(&ev.window()).unwrap();
window.destroy();
if self.state.lock().windows.is_empty() {
if let Some(ref mut fun) = self.callbacks.lock().quit {
fun();
}
}
let mut state = self.state.lock();
state.quit_requested |= state.windows.is_empty();
}
}
}
@ -164,6 +161,10 @@ impl Platform for LinuxPlatform {
runnable.run();
}
}
if let Some(ref mut fun) = self.callbacks.lock().quit {
fun();
}
}
fn quit(&self) {