|
@@ -2300,14 +2300,10 @@ fn handle_event_loop<T: UserEvent>(
|
|
#[cfg(feature = "system-tray")]
|
|
#[cfg(feature = "system-tray")]
|
|
tray_context,
|
|
tray_context,
|
|
} = context;
|
|
} = context;
|
|
- if *control_flow == ControlFlow::Exit {
|
|
|
|
- return RunIteration {
|
|
|
|
- window_count: windows.lock().expect("poisoned webview collection").len(),
|
|
|
|
- };
|
|
|
|
|
|
+ if *control_flow != ControlFlow::Exit {
|
|
|
|
+ *control_flow = ControlFlow::Wait;
|
|
}
|
|
}
|
|
|
|
|
|
- *control_flow = ControlFlow::Wait;
|
|
|
|
-
|
|
|
|
match event {
|
|
match event {
|
|
Event::NewEvents(StartCause::Init) => {
|
|
Event::NewEvents(StartCause::Init) => {
|
|
callback(RunEvent::Ready);
|
|
callback(RunEvent::Ready);
|
|
@@ -2321,6 +2317,10 @@ fn handle_event_loop<T: UserEvent>(
|
|
callback(RunEvent::MainEventsCleared);
|
|
callback(RunEvent::MainEventsCleared);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ Event::LoopDestroyed => {
|
|
|
|
+ callback(RunEvent::Exit);
|
|
|
|
+ }
|
|
|
|
+
|
|
Event::GlobalShortcutEvent(accelerator_id) => {
|
|
Event::GlobalShortcutEvent(accelerator_id) => {
|
|
for (id, handler) in &*global_shortcut_manager_handle.listeners.lock().unwrap() {
|
|
for (id, handler) in &*global_shortcut_manager_handle.listeners.lock().unwrap() {
|
|
if accelerator_id == *id {
|
|
if accelerator_id == *id {
|
|
@@ -2565,7 +2565,6 @@ fn on_window_close<'a, T: UserEvent>(
|
|
|
|
|
|
if !should_prevent {
|
|
if !should_prevent {
|
|
*control_flow = ControlFlow::Exit;
|
|
*control_flow = ControlFlow::Exit;
|
|
- callback(RunEvent::Exit);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
Some(webview)
|
|
Some(webview)
|