Fix application sometimes exiting at startup

This commit is contained in:
Héctor Ramón Jiménez 2024-06-20 22:28:28 +02:00
parent cbeda38f0d
commit 50dd2a6cc0
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -305,6 +305,7 @@ where
.send(Boot { .send(Boot {
compositor, compositor,
clipboard, clipboard,
window: window.id(),
is_daemon: window_settings.is_none(), is_daemon: window_settings.is_none(),
}) })
.ok() .ok()
@ -592,6 +593,7 @@ where
struct Boot<C> { struct Boot<C> {
compositor: C, compositor: C,
clipboard: Clipboard, clipboard: Clipboard,
window: winit::window::WindowId,
is_daemon: bool, is_daemon: bool,
} }
@ -634,6 +636,7 @@ async fn run_instance<P, C>(
let Boot { let Boot {
mut compositor, mut compositor,
mut clipboard, mut clipboard,
window: boot_window,
is_daemon, is_daemon,
} = boot.try_recv().ok().flatten().expect("Receive boot"); } = boot.try_recv().ok().flatten().expect("Receive boot");
@ -905,6 +908,7 @@ async fn run_instance<P, C>(
window_event, window_event,
winit::event::WindowEvent::Destroyed winit::event::WindowEvent::Destroyed
) )
&& window_id != boot_window
&& window_manager.is_empty() && window_manager.is_empty()
{ {
break 'main; break 'main;