diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-02-23 14:40:56 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-02-23 14:40:56 +0400 |
| commit | eb2dce1b530584496034bc6d7f14e9b29a487faf (patch) | |
| tree | bde5e6c9ebcde740136950111e554b6e16bc0254 /src/layout/workspace.rs | |
| parent | f5b776a9471b20f795823f8343a1ac24f5df4c1e (diff) | |
| download | niri-eb2dce1b530584496034bc6d7f14e9b29a487faf.tar.gz niri-eb2dce1b530584496034bc6d7f14e9b29a487faf.tar.bz2 niri-eb2dce1b530584496034bc6d7f14e9b29a487faf.zip | |
Fix default width fixed not being honored with borders
Diffstat (limited to 'src/layout/workspace.rs')
| -rw-r--r-- | src/layout/workspace.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/layout/workspace.rs b/src/layout/workspace.rs index 79889ef2..2f11cc4f 100644 --- a/src/layout/workspace.rs +++ b/src/layout/workspace.rs @@ -335,10 +335,14 @@ impl<W: LayoutElement> Workspace<W> { pub fn new_window_size(&self, width: Option<ColumnWidth>) -> Size<i32, Logical> { let width = if let Some(width) = width { + let is_fixed = matches!(width, ColumnWidth::Fixed(_)); + let mut width = width.resolve(&self.options, self.working_area.size.w); - if !self.options.border.off { + + if !is_fixed && !self.options.border.off { width -= self.options.border.width as i32 * 2; } + max(1, width) } else { 0 |
