summaryrefslogtreecommitdiff
path: root/src/Window.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Window.cpp')
-rw-r--r--src/Window.cpp32
1 files changed, 11 insertions, 21 deletions
diff --git a/src/Window.cpp b/src/Window.cpp
index d821b1b9..1a7b9de9 100644
--- a/src/Window.cpp
+++ b/src/Window.cpp
@@ -139,35 +139,25 @@ CBox CWindow::getWindowIdealBoundingBoxIgnoreReserved() {
return CBox{(int)POS.x, (int)POS.y, (int)SIZE.x, (int)SIZE.y};
}
-CBox CWindow::getWindowInputBox() {
- const int BORDERSIZE = getRealBorderSize();
+CBox CWindow::getWindowBoxUnified(uint64_t properties) {
if (m_sAdditionalConfigData.dimAround) {
const auto PMONITOR = g_pCompositor->getMonitorFromID(m_iMonitorID);
return {PMONITOR->vecPosition.x, PMONITOR->vecPosition.y, PMONITOR->vecSize.x, PMONITOR->vecSize.y};
}
- SWindowDecorationExtents maxExtents = {{BORDERSIZE + 2, BORDERSIZE + 2}, {BORDERSIZE + 2, BORDERSIZE + 2}};
-
- const auto EXTENTS = g_pDecorationPositioner->getWindowDecorationExtents(this, true);
-
- 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;
+ SWindowDecorationExtents EXTENTS = {{0, 0}, {0, 0}};
+ if (properties & RESERVED_EXTENTS)
+ EXTENTS.addExtents(g_pDecorationPositioner->getWindowDecorationReserved(this));
+ if (properties & INPUT_EXTENTS)
+ EXTENTS.addExtents(g_pDecorationPositioner->getWindowDecorationExtents(this, true));
+ if (properties & FULL_EXTENTS)
+ EXTENTS.addExtents(g_pDecorationPositioner->getWindowDecorationExtents(this, false));
- if (EXTENTS.bottomRight.y > maxExtents.bottomRight.y)
- maxExtents.bottomRight.y = EXTENTS.bottomRight.y;
+ CBox box = {m_vRealPosition.vec().x, m_vRealPosition.vec().y, m_vRealSize.vec().x, m_vRealSize.vec().y};
+ box.addExtents(EXTENTS);
- // Add extents to the real base BB and return
- CBox 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;
+ return box;
}
CBox CWindow::getWindowMainSurfaceBox() {