mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 11:45:58 +01:00
xdg-shell: even more robust layout min/max size
although I don't think any apps use this, but better safe than sorry
This commit is contained in:
parent
aa067a4cf1
commit
c4eda46d0e
1 changed files with 12 additions and 6 deletions
|
@ -324,15 +324,21 @@ void CXDGToplevelResource::close() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector2D CXDGToplevelResource::layoutMinSize() {
|
Vector2D CXDGToplevelResource::layoutMinSize() {
|
||||||
if (current.minSize.x <= 1 && current.minSize.y <= 1)
|
Vector2D minSize;
|
||||||
return {0, 0};
|
if (current.minSize.x > 1)
|
||||||
return owner ? current.minSize + owner->current.geometry.pos() : current.minSize;
|
minSize.x = owner ? current.minSize.x + owner->current.geometry.pos().x : current.minSize.x;
|
||||||
|
if (current.minSize.y > 1)
|
||||||
|
minSize.y = owner ? current.minSize.y + owner->current.geometry.pos().y : current.minSize.y;
|
||||||
|
return minSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector2D CXDGToplevelResource::layoutMaxSize() {
|
Vector2D CXDGToplevelResource::layoutMaxSize() {
|
||||||
if (current.maxSize.x <= 1 && current.maxSize.y <= 1)
|
Vector2D maxSize;
|
||||||
return {0, 0};
|
if (current.maxSize.x > 1)
|
||||||
return owner ? current.maxSize + owner->current.geometry.pos() : current.maxSize;
|
maxSize.x = owner ? current.maxSize.x + owner->current.geometry.pos().x : current.maxSize.x;
|
||||||
|
if (current.maxSize.y > 1)
|
||||||
|
maxSize.y = owner ? current.maxSize.y + owner->current.geometry.pos().y : current.maxSize.y;
|
||||||
|
return maxSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
CXDGSurfaceResource::CXDGSurfaceResource(SP<CXdgSurface> resource_, SP<CXDGWMBase> owner_, SP<CWLSurfaceResource> surface_) :
|
CXDGSurfaceResource::CXDGSurfaceResource(SP<CXdgSurface> resource_, SP<CXDGWMBase> owner_, SP<CWLSurfaceResource> surface_) :
|
||||||
|
|
Loading…
Reference in a new issue