diff options
Diffstat (limited to 'src/Window.cpp')
| -rw-r--r-- | src/Window.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/Window.cpp b/src/Window.cpp index 5bb1738e..2182d47c 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -13,4 +13,34 @@ CWindow::~CWindow() { g_pCompositor->m_pLastFocus = nullptr; g_pCompositor->m_pLastWindow = nullptr; } +} + +wlr_box CWindow::getFullWindowBoundingBox() { + + SWindowDecorationExtents maxExtents; + + for (auto& wd : m_dWindowDecorations) { + + const auto EXTENTS = wd->getWindowDecorationExtents(); + + if (EXTENTS.topLeft.x > maxExtents.topLeft.x) + maxExtents.topLeft.x = EXTENTS.topLeft.x; + + if (EXTENTS.topLeft.y > maxExtents.topLeft.y) + maxExtents.topLeft.y = EXTENTS.topLeft.y; + + if (EXTENTS.bottomRight.x > maxExtents.bottomRight.x) + maxExtents.bottomRight.x = EXTENTS.bottomRight.x; + + if (EXTENTS.bottomRight.y > maxExtents.bottomRight.y) + maxExtents.bottomRight.y = EXTENTS.bottomRight.y; + } + + // Add extents to the real base BB and return + wlr_box finalBox = {m_vRealPosition.vec().x - maxExtents.topLeft.x, + m_vRealPosition.vec().y - maxExtents.topLeft.y, + m_vRealSize.vec().x + maxExtents.topLeft.x + maxExtents.bottomRight.x, + m_vRealSize.vec().y + maxExtents.topLeft.y + maxExtents.bottomRight.y}; + + return finalBox; }
\ No newline at end of file |
