From 4b20d4f1add40130653b9a3f2351eb44e0e0df4b Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Tue, 28 Feb 2023 19:36:36 +0000 Subject: Added decoration reserved area --- src/Window.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/Window.cpp') diff --git a/src/Window.cpp b/src/Window.cpp index 549133d5..e06c3d3a 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -88,6 +88,22 @@ wlr_box CWindow::getWindowIdealBoundingBoxIgnoreReserved() { return wlr_box{(int)POS.x, (int)POS.y, (int)SIZE.x, (int)SIZE.y}; } +SWindowDecorationExtents CWindow::getFullWindowReservedArea() { + SWindowDecorationExtents extents; + + for (auto& wd : m_dWindowDecorations) { + const auto RESERVED = wd->getWindowDecorationReservedArea(); + + if (RESERVED.bottomRight == Vector2D{} && RESERVED.topLeft == Vector2D{}) + continue; + + extents.topLeft = extents.topLeft + RESERVED.topLeft; + extents.bottomRight = extents.bottomRight + RESERVED.bottomRight; + } + + return extents; +} + void CWindow::updateWindowDecos() { for (auto& wd : m_dWindowDecorations) wd->updateWindow(this); -- cgit v1.2.3