add window visibility

This commit is contained in:
Cory Forsstrom 2021-04-08 12:58:08 -07:00
parent 3ea2c4595a
commit cdab8f90fb
4 changed files with 34 additions and 1 deletions

View file

@ -191,6 +191,13 @@ pub trait Application: Sized {
false
}
/// Returns whether the [`Application`] should be visible or not
///
/// By default, it returns `true`.
fn visible(&self) -> bool {
true
}
/// Runs the [`Application`].
///
/// On native platforms, this method will take control of the current thread
@ -295,6 +302,10 @@ where
fn should_exit(&self) -> bool {
self.0.should_exit()
}
fn visible(&self) -> bool {
self.0.visible()
}
}
#[cfg(target_arch = "wasm32")]