diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-12-11 09:27:38 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-12-30 20:12:37 +0300 |
| commit | 10460191b93194ed4d9dc16e1fd7a2eb6f297ae3 (patch) | |
| tree | 7188b36849ef71caca2a1cf69fc577c351dc4f0f /src/window | |
| parent | c5fffd6e2c48aa7fb8b45b8bdcd972bbd8ce900b (diff) | |
| download | niri-10460191b93194ed4d9dc16e1fd7a2eb6f297ae3.tar.gz niri-10460191b93194ed4d9dc16e1fd7a2eb6f297ae3.tar.bz2 niri-10460191b93194ed4d9dc16e1fd7a2eb6f297ae3.zip | |
Honor min/max size in more places like initial configure
Diffstat (limited to 'src/window')
| -rw-r--r-- | src/window/mod.rs | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/window/mod.rs b/src/window/mod.rs index 4f4b6674..9a44319a 100644 --- a/src/window/mod.rs +++ b/src/window/mod.rs @@ -285,6 +285,16 @@ impl ResolvedWindowRules { size } + pub fn apply_min_max_size( + &self, + min_size: Size<i32, Logical>, + max_size: Size<i32, Logical>, + ) -> (Size<i32, Logical>, Size<i32, Logical>) { + let min_size = self.apply_min_size(min_size); + let max_size = self.apply_max_size(max_size); + (min_size, max_size) + } + pub fn compute_open_floating(&self, toplevel: &ToplevelSurface) -> bool { if let Some(res) = self.open_floating { return res; @@ -295,13 +305,12 @@ impl ResolvedWindowRules { return true; } - let (mut min_size, mut max_size) = with_states(toplevel.wl_surface(), |state| { + let (min_size, max_size) = with_states(toplevel.wl_surface(), |state| { let mut guard = state.cached_state.get::<SurfaceCachedState>(); let current = guard.current(); (current.min_size, current.max_size) }); - min_size = self.apply_min_size(min_size); - max_size = self.apply_max_size(max_size); + let (min_size, max_size) = self.apply_min_max_size(min_size, max_size); // We open fixed-height windows as floating. min_size.h > 0 && min_size.h == max_size.h |
