diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-03-19 14:32:07 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-03-19 18:29:13 +0400 |
| commit | f31e105043a9fae0fae3dcfe0feb7ea1193d5f77 (patch) | |
| tree | 15602138d8cd812bfd33c6e6213433a87ce5c344 /src/window.rs | |
| parent | bbb4caeb8ccba52949799e7a229ee710ffa23564 (diff) | |
| download | niri-f31e105043a9fae0fae3dcfe0feb7ea1193d5f77.tar.gz niri-f31e105043a9fae0fae3dcfe0feb7ea1193d5f77.tar.bz2 niri-f31e105043a9fae0fae3dcfe0feb7ea1193d5f77.zip | |
Make window a subdirectory
Diffstat (limited to 'src/window.rs')
| -rw-r--r-- | src/window.rs | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/src/window.rs b/src/window.rs deleted file mode 100644 index a5023afa..00000000 --- a/src/window.rs +++ /dev/null @@ -1,80 +0,0 @@ -use smithay::desktop::Window; -use smithay::output::Output; - -use crate::layout::workspace::ColumnWidth; - -#[derive(Debug)] -pub struct Unmapped { - pub window: Window, - pub state: InitialConfigureState, -} - -#[derive(Debug)] -pub enum InitialConfigureState { - /// The window has not been initially configured yet. - NotConfigured { - /// Whether the window requested to be fullscreened, and the requested output, if any. - wants_fullscreen: Option<Option<Output>>, - }, - /// The window has been configured. - Configured { - /// Up-to-date rules. - /// - /// We start tracking window rules when sending the initial configure, since they don't - /// affect anything before that. - rules: ResolvedWindowRules, - - /// Resolved default width for this window. - /// - /// `None` means that the window will pick its own width. - width: Option<ColumnWidth>, - - /// Whether the window should open full-width. - is_full_width: bool, - - /// Output to open this window on. - /// - /// This can be `None` in cases like: - /// - /// - There are no outputs connected. - /// - This is a dialog with a parent, and there was no explicit output set, so this dialog - /// should fetch the parent's current output again upon mapping. - output: Option<Output>, - }, -} - -/// Rules fully resolved for a window. -#[derive(Debug, Default)] -pub struct ResolvedWindowRules { - /// Default width for this window. - /// - /// - `None`: unset (global default should be used). - /// - `Some(None)`: set to empty (window picks its own width). - /// - `Some(Some(width))`: set to a particular width. - pub default_width: Option<Option<ColumnWidth>>, - - /// Output to open this window on. - pub open_on_output: Option<String>, - - /// Whether the window should open full-width. - pub open_maximized: Option<bool>, - - /// Whether the window should open fullscreen. - pub open_fullscreen: Option<bool>, -} - -impl Unmapped { - /// Wraps a newly created window that hasn't been initially configured yet. - pub fn new(window: Window) -> Self { - Self { - window, - state: InitialConfigureState::NotConfigured { - wants_fullscreen: None, - }, - } - } - - pub fn needs_initial_configure(&self) -> bool { - matches!(self.state, InitialConfigureState::NotConfigured { .. }) - } -} |
