Make window a subdirectory
Browse files at this commitf31e105043a9fae0fae3dcfe0feb7ea1193d5f77Parent: bbb4cae2 changed files +25 -20
- src/window/mod.rs +24 -0
- src/window.rs → src/window/unmapped.rs +1 -20
src/window/mod.rsadded+24 -0
| @@ -0,0 +1,24 @@ | |||
| 1 | +use crate::layout::workspace::ColumnWidth; | ||
| 2 | + | ||
| 3 | +pub mod unmapped; | ||
| 4 | +pub use unmapped::{InitialConfigureState, Unmapped}; | ||
| 5 | + | ||
| 6 | +/// Rules fully resolved for a window. | ||
| 7 | +#[derive(Debug, Default)] | ||
| 8 | +pub struct ResolvedWindowRules { | ||
| 9 | + /// Default width for this window. | ||
| 10 | + /// | ||
| 11 | + /// - `None`: unset (global default should be used). | ||
| 12 | + /// - `Some(None)`: set to empty (window picks its own width). | ||
| 13 | + /// - `Some(Some(width))`: set to a particular width. | ||
| 14 | + pub default_width: Option<Option<ColumnWidth>>, | ||
| 15 | + | ||
| 16 | + /// Output to open this window on. | ||
| 17 | + pub open_on_output: Option<String>, | ||
| 18 | + | ||
| 19 | + /// Whether the window should open full-width. | ||
| 20 | + pub open_maximized: Option<bool>, | ||
| 21 | + | ||
| 22 | + /// Whether the window should open fullscreen. | ||
| 23 | + pub open_fullscreen: Option<bool>, | ||
| 24 | +} | ||
src/window.rs → src/window/unmapped.rsrenamed+1 -20
| @@ -1,6 +1,7 @@ | |||
| 1 | use smithay::desktop::Window; | 1 | use smithay::desktop::Window; |
| 2 | use smithay::output::Output; | 2 | use smithay::output::Output; |
| 3 | 3 | ||
| 4 | +use super::ResolvedWindowRules; | ||
| 4 | use crate::layout::workspace::ColumnWidth; | 5 | use crate::layout::workspace::ColumnWidth; |
| 5 | 6 | ||
| 6 | #[derive(Debug)] | 7 | #[derive(Debug)] |
| @@ -43,26 +44,6 @@ pub enum InitialConfigureState { | |||
| 43 | }, | 44 | }, |
| 44 | } | 45 | } |
| 45 | 46 | ||
| 46 | -/// Rules fully resolved for a window. | ||
| 47 | -#[derive(Debug, Default)] | ||
| 48 | -pub struct ResolvedWindowRules { | ||
| 49 | - /// Default width for this window. | ||
| 50 | - /// | ||
| 51 | - /// - `None`: unset (global default should be used). | ||
| 52 | - /// - `Some(None)`: set to empty (window picks its own width). | ||
| 53 | - /// - `Some(Some(width))`: set to a particular width. | ||
| 54 | - pub default_width: Option<Option<ColumnWidth>>, | ||
| 55 | - | ||
| 56 | - /// Output to open this window on. | ||
| 57 | - pub open_on_output: Option<String>, | ||
| 58 | - | ||
| 59 | - /// Whether the window should open full-width. | ||
| 60 | - pub open_maximized: Option<bool>, | ||
| 61 | - | ||
| 62 | - /// Whether the window should open fullscreen. | ||
| 63 | - pub open_fullscreen: Option<bool>, | ||
| 64 | -} | ||
| 65 | - | ||
| 66 | impl Unmapped { | 47 | impl Unmapped { |
| 67 | /// Wraps a newly created window that hasn't been initially configured yet. | 48 | /// Wraps a newly created window that hasn't been initially configured yet. |
| 68 | pub fn new(window: Window) -> Self { | 49 | pub fn new(window: Window) -> Self { |