diff --git a/core/src/settings.rs b/core/src/settings.rs index e3eb433a..be744b36 100644 --- a/core/src/settings.rs +++ b/core/src/settings.rs @@ -43,6 +43,9 @@ pub struct Settings { /// If set to true the application will exit when the main window is closed. pub exit_on_close_request: bool, + + /// Whether the application is a daemon + pub is_daemon: bool, } impl Default for Settings { @@ -55,6 +58,7 @@ impl Default for Settings { default_text_size: Pixels(14.0), antialiasing: false, exit_on_close_request: false, + is_daemon: false, } } } @@ -65,6 +69,7 @@ impl From for iced_winit::Settings { iced_winit::Settings { id: settings.id, fonts: settings.fonts, + is_daemon: settings.is_daemon, } } } diff --git a/winit/src/lib.rs b/winit/src/lib.rs index 05abcce8..5f5fcfa4 100644 --- a/winit/src/lib.rs +++ b/winit/src/lib.rs @@ -123,7 +123,7 @@ where }; let (program, task) = runtime.enter(|| program::Instance::new(program)); - let is_daemon = window_settings.is_none(); + let is_daemon = settings.is_daemon || window_settings.is_none(); let task = if let Some(window_settings) = window_settings { let mut task = Some(task);