pub enum WindowRole {
Primary,
Secondary,
}Expand description
Whether a window keeps the app alive (docs/windows.md close policy).
A separate axis from WindowKind, which describes chrome. They correlate (a
preferences panel is the archetypal window that should not hold an app open), but they are
not the same question, and conflating them would leave no way to say “an ordinary-looking
tool window that shouldn’t outlive the documents”.
Note the word “secondary” is overloaded around windows: elsewhere in day it means “a window other than the first one opened”. Here it means “does not keep the app alive”, which is about lifetime, not about order of creation.
Variants§
Primary
Closing the last one of these ends the app.
Secondary
Never keeps the app alive: when the last Primary closes, the app exits and takes
these with it, however many are open.
Trait Implementations§
Source§impl Clone for WindowRole
impl Clone for WindowRole
Source§fn clone(&self) -> WindowRole
fn clone(&self) -> WindowRole
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for WindowRole
Source§impl Debug for WindowRole
impl Debug for WindowRole
Source§impl Default for WindowRole
impl Default for WindowRole
Source§fn default() -> WindowRole
fn default() -> WindowRole
impl Eq for WindowRole
Source§impl From<WindowKind> for WindowRole
impl From<WindowKind> for WindowRole
Source§fn from(kind: WindowKind) -> WindowRole
fn from(kind: WindowKind) -> WindowRole
The default pairing: an ordinary window holds the app open, a preferences panel does not. An app that needs a different answer sets the role itself.