mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 07:03:15 -04:00
Add exit code to control flow and impl on linux
This commit is contained in:
@@ -655,7 +655,7 @@ impl<T: 'static> EventLoop<T> {
|
||||
x11_or_wayland!(match self; EventLoop(evlp) => evlp.create_proxy(); as EventLoopProxy)
|
||||
}
|
||||
|
||||
pub fn run_return<F>(&mut self, callback: F)
|
||||
pub fn run_return<F>(&mut self, callback: F) -> i32
|
||||
where
|
||||
F: FnMut(crate::event::Event<'_, T>, &RootELW<T>, &mut ControlFlow),
|
||||
{
|
||||
@@ -743,8 +743,9 @@ fn sticky_exit_callback<T, F>(
|
||||
{
|
||||
// make ControlFlow::Exit sticky by providing a dummy
|
||||
// control flow reference if it is already Exit.
|
||||
let mut dummy = ControlFlow::Exit;
|
||||
let cf = if *control_flow == ControlFlow::Exit {
|
||||
let mut dummy;
|
||||
let cf = if let ControlFlow::Exit(code) = *control_flow {
|
||||
dummy = ControlFlow::Exit(code);
|
||||
&mut dummy
|
||||
} else {
|
||||
control_flow
|
||||
|
||||
Reference in New Issue
Block a user