From cdab8f90fb525c509e0a15bb1d0b3d7213e176f3 Mon Sep 17 00:00:00 2001 From: Cory Forsstrom Date: Thu, 8 Apr 2021 12:58:08 -0700 Subject: add window visibility --- winit/src/application.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'winit/src/application.rs') diff --git a/winit/src/application.rs b/winit/src/application.rs index 106d5218..e73f3df1 100644 --- a/winit/src/application.rs +++ b/winit/src/application.rs @@ -98,6 +98,13 @@ pub trait Application: Program { fn should_exit(&self) -> bool { false } + + /// Returns whether the [`Application`] should be visible or not + /// + /// By default, it returns `true`. + fn visible(&self) -> bool { + true + } } /// Runs an [`Application`] with an executor, compositor, and the provided @@ -145,6 +152,7 @@ where .into_builder( &application.title(), application.mode(), + application.visible(), event_loop.primary_monitor(), ) .build(&event_loop) -- cgit