diff options
Diffstat (limited to 'src/window')
| -rw-r--r-- | src/window/mod.rs | 10 | ||||
| -rw-r--r-- | src/window/unmapped.rs | 4 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/window/mod.rs b/src/window/mod.rs index 4ccbb111..92b4f793 100644 --- a/src/window/mod.rs +++ b/src/window/mod.rs @@ -33,6 +33,9 @@ pub struct ResolvedWindowRules { /// Output to open this window on. pub open_on_output: Option<String>, + /// Workspace to open this window on. + pub open_on_workspace: Option<String>, + /// Whether the window should open full-width. pub open_maximized: Option<bool>, @@ -99,6 +102,7 @@ impl ResolvedWindowRules { Self { default_width: None, open_on_output: None, + open_on_workspace: None, open_maximized: None, open_fullscreen: None, min_width: None, @@ -151,6 +155,7 @@ impl ResolvedWindowRules { } let mut open_on_output = None; + let mut open_on_workspace = None; for rule in rules { let matches = |m| window_matches(window, &role, m); @@ -175,6 +180,10 @@ impl ResolvedWindowRules { open_on_output = Some(x); } + if let Some(x) = rule.open_on_workspace.as_deref() { + open_on_workspace = Some(x); + } + if let Some(x) = rule.open_maximized { resolved.open_maximized = Some(x); } @@ -217,6 +226,7 @@ impl ResolvedWindowRules { } resolved.open_on_output = open_on_output.map(|x| x.to_owned()); + resolved.open_on_workspace = open_on_workspace.map(|x| x.to_owned()); }); resolved diff --git a/src/window/unmapped.rs b/src/window/unmapped.rs index 9cde4ca7..a74c4e24 100644 --- a/src/window/unmapped.rs +++ b/src/window/unmapped.rs @@ -11,6 +11,7 @@ pub struct Unmapped { pub state: InitialConfigureState, } +#[allow(clippy::large_enum_variant)] #[derive(Debug)] pub enum InitialConfigureState { /// The window has not been initially configured yet. @@ -42,6 +43,9 @@ pub enum InitialConfigureState { /// - 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>, + + /// Workspace to open this window on. + workspace_name: Option<String>, }, } |
