aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2024-02-23 14:31:35 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2024-02-23 14:31:35 +0400
commitf5b776a9471b20f795823f8343a1ac24f5df4c1e (patch)
treeaf14e144ab17381606f4417e6a79b6c9f9c7c113 /src
parent6a587245eb79a0e054c7283eb2a97d694482e834 (diff)
downloadniri-f5b776a9471b20f795823f8343a1ac24f5df4c1e.tar.gz
niri-f5b776a9471b20f795823f8343a1ac24f5df4c1e.tar.bz2
niri-f5b776a9471b20f795823f8343a1ac24f5df4c1e.zip
Fix unset default width causing a window resize right away
Diffstat (limited to 'src')
-rw-r--r--src/layout/mod.rs24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs
index c7239a2b..4fc8021a 100644
--- a/src/layout/mod.rs
+++ b/src/layout/mod.rs
@@ -534,7 +534,13 @@ impl<W: LayoutElement> Layout<W> {
width: Option<ColumnWidth>,
is_full_width: bool,
) -> Option<&Output> {
- let width = width.unwrap_or_else(|| ColumnWidth::Fixed(window.size().w));
+ let width = width.unwrap_or_else(|| {
+ let mut width = window.size().w;
+ if !self.options.border.off {
+ width += self.options.border.width as i32 * 2;
+ }
+ ColumnWidth::Fixed(width)
+ });
match &mut self.monitor_set {
MonitorSet::Normal {
@@ -585,7 +591,13 @@ impl<W: LayoutElement> Layout<W> {
width: Option<ColumnWidth>,
is_full_width: bool,
) -> Option<&Output> {
- let width = width.unwrap_or_else(|| ColumnWidth::Fixed(window.size().w));
+ let width = width.unwrap_or_else(|| {
+ let mut width = window.size().w;
+ if !self.options.border.off {
+ width += self.options.border.width as i32 * 2;
+ }
+ ColumnWidth::Fixed(width)
+ });
match &mut self.monitor_set {
MonitorSet::Normal { monitors, .. } => {
@@ -616,7 +628,13 @@ impl<W: LayoutElement> Layout<W> {
width: Option<ColumnWidth>,
is_full_width: bool,
) {
- let width = width.unwrap_or_else(|| ColumnWidth::Fixed(window.size().w));
+ let width = width.unwrap_or_else(|| {
+ let mut width = window.size().w;
+ if !self.options.border.off {
+ width += self.options.border.width as i32 * 2;
+ }
+ ColumnWidth::Fixed(width)
+ });
let MonitorSet::Normal {
monitors,