refactor(shell/element): refactor how decorations height is accessed

This fixes several things:
- The xwayland code previously incorrectly used the SSD_HEIGHT (for Windows) even when the X11 surface was in a stack
- The SSD_HEIGHT was defined in surface.rs, even though rendering serverside decorations is done in the window/stack

Rename (min|max)_size to (min|max)_size_without_ssd in CosmicSurface and make it act accordingly
Add a new (min|max)_size() in CosmicWindow and CosmicStack, which takes the surface's (min|max)_size and adds the decorations.
Change all callers to use (min|max)_size() from the window or stack respectively, except is_dialog() where it does not matter.
This commit is contained in:
Yureka 2024-12-25 14:11:22 +01:00 committed by Victoria Brekenfeld
parent 1118aa2877
commit 9b78a2d780
6 changed files with 103 additions and 80 deletions

View file

@ -44,8 +44,8 @@ pub fn is_dialog(window: &CosmicSurface) -> bool {
};
// Check if sizing suggest dialog
let max_size = window.max_size();
let min_size = window.min_size();
let max_size = window.max_size_without_ssd();
let min_size = window.min_size_without_ssd();
if min_size.is_some() && min_size == max_size {
return true;