diff options
| author | Vaxry <vaxry@vaxry.net> | 2024-11-17 19:31:54 +0000 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2024-11-17 19:31:54 +0000 |
| commit | b735295d2b0025b26f88852c06f65514a963c711 (patch) | |
| tree | 166560e38a396af304db4ec28ca14ba7bb7eedba /src/protocols | |
| parent | 8d5cdedbd350b4730a1aa57dc5491c88dff3415e (diff) | |
windows/xdg: minor cleanup of min/max size calculations
fixes #8495
Diffstat (limited to 'src/protocols')
| -rw-r--r-- | src/protocols/XDGShell.cpp | 8 | ||||
| -rw-r--r-- | src/protocols/XDGShell.hpp | 3 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/protocols/XDGShell.cpp b/src/protocols/XDGShell.cpp index 25d8b1ba..932882e9 100644 --- a/src/protocols/XDGShell.cpp +++ b/src/protocols/XDGShell.cpp @@ -323,6 +323,14 @@ void CXDGToplevelResource::close() { resource->sendClose(); } +Vector2D CXDGToplevelResource::layoutMinSize() { + return owner ? current.minSize + owner->current.geometry.pos() : current.minSize; +} + +Vector2D CXDGToplevelResource::layoutMaxSize() { + return owner ? current.maxSize + owner->current.geometry.pos() : current.maxSize; +} + CXDGSurfaceResource::CXDGSurfaceResource(SP<CXdgSurface> resource_, SP<CXDGWMBase> owner_, SP<CWLSurfaceResource> surface_) : owner(owner_), surface(surface_), resource(resource_) { if (!good()) diff --git a/src/protocols/XDGShell.hpp b/src/protocols/XDGShell.hpp index 9c766c20..ef847f3b 100644 --- a/src/protocols/XDGShell.hpp +++ b/src/protocols/XDGShell.hpp @@ -99,6 +99,9 @@ class CXDGToplevelResource { bool good(); + Vector2D layoutMinSize(); + Vector2D layoutMaxSize(); + // schedule a configure event uint32_t setSize(const Vector2D& size); uint32_t setMaximized(bool maximized); |
