aboutsummaryrefslogtreecommitdiff
path: root/src/layout/tile.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2025-03-17 07:45:26 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2025-03-17 22:31:19 -0700
commit6a80ec4704b767483866eec41f9f08432991c35a (patch)
tree65d6edff11a5677a721923f92e748a22519e0871 /src/layout/tile.rs
parente8b158641b43fa1691beb89f0224e3641b1aaad9 (diff)
downloadniri-6a80ec4704b767483866eec41f9f08432991c35a.tar.gz
niri-6a80ec4704b767483866eec41f9f08432991c35a.tar.bz2
niri-6a80ec4704b767483866eec41f9f08432991c35a.zip
layout/tile: Don't take fullscreen into account in min/max size
They are used strictly for non-fullscreen size computation.
Diffstat (limited to 'src/layout/tile.rs')
-rw-r--r--src/layout/tile.rs14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/layout/tile.rs b/src/layout/tile.rs
index 518d08cc..891ac3f6 100644
--- a/src/layout/tile.rs
+++ b/src/layout/tile.rs
@@ -758,10 +758,13 @@ impl<W: LayoutElement> Tile<W> {
.request_size(self.view_size.to_i32_round(), true, animate, transaction);
}
- pub fn min_size(&self) -> Size<f64, Logical> {
+ pub fn min_size_nonfullscreen(&self) -> Size<f64, Logical> {
let mut size = self.window.min_size().to_f64();
- if let Some(width) = self.effective_border_width() {
+ // Can't go through effective_border_width() because we might be fullscreen.
+ if !self.border.is_off() {
+ let width = self.border.width();
+
size.w = f64::max(1., size.w);
size.h = f64::max(1., size.h);
@@ -772,10 +775,13 @@ impl<W: LayoutElement> Tile<W> {
size
}
- pub fn max_size(&self) -> Size<f64, Logical> {
+ pub fn max_size_nonfullscreen(&self) -> Size<f64, Logical> {
let mut size = self.window.max_size().to_f64();
- if let Some(width) = self.effective_border_width() {
+ // Can't go through effective_border_width() because we might be fullscreen.
+ if !self.border.is_off() {
+ let width = self.border.width();
+
if size.w > 0. {
size.w += width * 2.;
}