From a0e2a15c60162e4f0a589fb5f0ce0899bce213b5 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Fri, 31 Jan 2025 19:24:26 +0300 Subject: Take border into account for fixed preset-column-width for tiled windows --- src/window/mod.rs | 11 +++-------- src/window/unmapped.rs | 5 ++--- 2 files changed, 5 insertions(+), 11 deletions(-) (limited to 'src/window') diff --git a/src/window/mod.rs b/src/window/mod.rs index 92023032..cc681010 100644 --- a/src/window/mod.rs +++ b/src/window/mod.rs @@ -11,7 +11,6 @@ use smithay::wayland::shell::xdg::{ SurfaceCachedState, ToplevelSurface, XdgToplevelSurfaceRoleAttributes, }; -use crate::layout::scrolling::ColumnWidth; use crate::utils::with_toplevel_role; pub mod mapped; @@ -35,7 +34,7 @@ pub struct ResolvedWindowRules { /// - `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>, + pub default_width: Option>, /// Default height for this window. /// @@ -230,12 +229,8 @@ impl ResolvedWindowRules { continue; } - if let Some(x) = rule - .default_column_width - .as_ref() - .map(|d| d.0.map(ColumnWidth::from)) - { - resolved.default_width = Some(x); + if let Some(x) = rule.default_column_width { + resolved.default_width = Some(x.0); } if let Some(x) = rule.default_window_height { diff --git a/src/window/unmapped.rs b/src/window/unmapped.rs index cf8754b4..6ca11b50 100644 --- a/src/window/unmapped.rs +++ b/src/window/unmapped.rs @@ -5,7 +5,6 @@ use smithay::wayland::shell::xdg::ToplevelSurface; use smithay::wayland::xdg_activation::XdgActivationTokenData; use super::ResolvedWindowRules; -use crate::layout::scrolling::ColumnWidth; #[derive(Debug)] pub struct Unmapped { @@ -34,7 +33,7 @@ pub enum InitialConfigureState { /// Resolved scrolling default width for this window. /// /// `None` means that the window will pick its own width. - width: Option, + width: Option, /// Resolved scrolling default height for this window. /// @@ -44,7 +43,7 @@ pub enum InitialConfigureState { /// Resolved floating default width for this window. /// /// `None` means that the window will pick its own width. - floating_width: Option, + floating_width: Option, /// Resolved floating default height for this window. /// -- cgit