linux: quit after the last window is closed (#7602)
Release Notes: - N/A
This commit is contained in:
parent
91c699aeaa
commit
0ab1094f0c
1 changed files with 6 additions and 5 deletions
|
@ -125,11 +125,8 @@ impl Platform for LinuxPlatform {
|
||||||
// window "x" button clicked by user, we gracefully exit
|
// window "x" button clicked by user, we gracefully exit
|
||||||
let window = self.state.lock().windows.remove(&ev.window()).unwrap();
|
let window = self.state.lock().windows.remove(&ev.window()).unwrap();
|
||||||
window.destroy();
|
window.destroy();
|
||||||
if self.state.lock().windows.is_empty() {
|
let mut state = self.state.lock();
|
||||||
if let Some(ref mut fun) = self.callbacks.lock().quit {
|
state.quit_requested |= state.windows.is_empty();
|
||||||
fun();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -164,6 +161,10 @@ impl Platform for LinuxPlatform {
|
||||||
runnable.run();
|
runnable.run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let Some(ref mut fun) = self.callbacks.lock().quit {
|
||||||
|
fun();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn quit(&self) {
|
fn quit(&self) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue