From f31e105043a9fae0fae3dcfe0feb7ea1193d5f77 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Tue, 19 Mar 2024 14:32:07 +0400 Subject: [PATCH] Make window a subdirectory --- src/window/mod.rs | 24 ++++++++++++++++++++++++ src/{window.rs => window/unmapped.rs} | 21 +-------------------- 2 files changed, 25 insertions(+), 20 deletions(-) create mode 100644 src/window/mod.rs rename src/{window.rs => window/unmapped.rs} (73%) diff --git a/src/window/mod.rs b/src/window/mod.rs new file mode 100644 index 00000000..fd494b42 --- /dev/null +++ b/src/window/mod.rs @@ -0,0 +1,24 @@ +use crate::layout::workspace::ColumnWidth; + +pub mod unmapped; +pub use unmapped::{InitialConfigureState, Unmapped}; + +/// 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>, + + /// Output to open this window on. + pub open_on_output: Option, + + /// Whether the window should open full-width. + pub open_maximized: Option, + + /// Whether the window should open fullscreen. + pub open_fullscreen: Option, +} diff --git a/src/window.rs b/src/window/unmapped.rs similarity index 73% rename from src/window.rs rename to src/window/unmapped.rs index a5023afa..51e37e07 100644 --- a/src/window.rs +++ b/src/window/unmapped.rs @@ -1,6 +1,7 @@ use smithay::desktop::Window; use smithay::output::Output; +use super::ResolvedWindowRules; use crate::layout::workspace::ColumnWidth; #[derive(Debug)] @@ -43,26 +44,6 @@ pub enum InitialConfigureState { }, } -/// 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>, - - /// Output to open this window on. - pub open_on_output: Option, - - /// Whether the window should open full-width. - pub open_maximized: Option, - - /// Whether the window should open fullscreen. - pub open_fullscreen: Option, -} - impl Unmapped { /// Wraps a newly created window that hasn't been initially configured yet. pub fn new(window: Window) -> Self {