mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-22 02:01:55 +07:00
Fix default width fixed not being honored with borders
This commit is contained in:
+12
-15
@@ -534,13 +534,12 @@ impl<W: LayoutElement> Layout<W> {
|
||||
width: Option<ColumnWidth>,
|
||||
is_full_width: bool,
|
||||
) -> Option<&Output> {
|
||||
let width = width.unwrap_or_else(|| {
|
||||
let mut width = window.size().w;
|
||||
let mut width = width.unwrap_or_else(|| ColumnWidth::Fixed(window.size().w));
|
||||
if let ColumnWidth::Fixed(w) = &mut width {
|
||||
if !self.options.border.off {
|
||||
width += self.options.border.width as i32 * 2;
|
||||
*w += self.options.border.width as i32 * 2;
|
||||
}
|
||||
ColumnWidth::Fixed(width)
|
||||
});
|
||||
}
|
||||
|
||||
match &mut self.monitor_set {
|
||||
MonitorSet::Normal {
|
||||
@@ -591,13 +590,12 @@ impl<W: LayoutElement> Layout<W> {
|
||||
width: Option<ColumnWidth>,
|
||||
is_full_width: bool,
|
||||
) -> Option<&Output> {
|
||||
let width = width.unwrap_or_else(|| {
|
||||
let mut width = window.size().w;
|
||||
let mut width = width.unwrap_or_else(|| ColumnWidth::Fixed(window.size().w));
|
||||
if let ColumnWidth::Fixed(w) = &mut width {
|
||||
if !self.options.border.off {
|
||||
width += self.options.border.width as i32 * 2;
|
||||
*w += self.options.border.width as i32 * 2;
|
||||
}
|
||||
ColumnWidth::Fixed(width)
|
||||
});
|
||||
}
|
||||
|
||||
match &mut self.monitor_set {
|
||||
MonitorSet::Normal { monitors, .. } => {
|
||||
@@ -628,13 +626,12 @@ impl<W: LayoutElement> Layout<W> {
|
||||
width: Option<ColumnWidth>,
|
||||
is_full_width: bool,
|
||||
) {
|
||||
let width = width.unwrap_or_else(|| {
|
||||
let mut width = window.size().w;
|
||||
let mut width = width.unwrap_or_else(|| ColumnWidth::Fixed(window.size().w));
|
||||
if let ColumnWidth::Fixed(w) = &mut width {
|
||||
if !self.options.border.off {
|
||||
width += self.options.border.width as i32 * 2;
|
||||
*w += self.options.border.width as i32 * 2;
|
||||
}
|
||||
ColumnWidth::Fixed(width)
|
||||
});
|
||||
}
|
||||
|
||||
let MonitorSet::Normal {
|
||||
monitors,
|
||||
|
||||
Reference in New Issue
Block a user