Skip to content

Commit

Permalink
Fix application sometimes exiting at startup
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Jun 20, 2024
1 parent cbeda38 commit 50dd2a6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions winit/src/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ where
.send(Boot {
compositor,
clipboard,
window: window.id(),
is_daemon: window_settings.is_none(),
})
.ok()
Expand Down Expand Up @@ -592,6 +593,7 @@ where
struct Boot<C> {
compositor: C,
clipboard: Clipboard,
window: winit::window::WindowId,
is_daemon: bool,
}

Expand Down Expand Up @@ -634,6 +636,7 @@ async fn run_instance<P, C>(
let Boot {
mut compositor,
mut clipboard,
window: boot_window,
is_daemon,
} = boot.try_recv().ok().flatten().expect("Receive boot");

Expand Down Expand Up @@ -905,6 +908,7 @@ async fn run_instance<P, C>(
window_event,
winit::event::WindowEvent::Destroyed
)
&& window_id != boot_window
&& window_manager.is_empty()
{
break 'main;
Expand Down

0 comments on commit 50dd2a6

Please sign in to comment.