summaryrefslogtreecommitdiff
path: root/src/Window.cpp
diff options
context:
space:
mode:
authorxDarksome <dev@darkso.me>2022-06-24 18:58:11 +0300
committerGitHub <noreply@github.com>2022-06-24 18:58:11 +0300
commitbe460ea9547691eb136bf8b600b67b778af47e3f (patch)
treeb74869ad39dd804aec31694d4dd429822c223644 /src/Window.cpp
parent776ca3baf269059e8c13ba8b625645215e71f78c (diff)
parente7467c60f9fe9e66c74dd8dc7c752a73ed4bc4db (diff)
Merge branch 'hyprwm:main' into main
Diffstat (limited to 'src/Window.cpp')
-rw-r--r--src/Window.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/Window.cpp b/src/Window.cpp
index 2182d47c..8476360a 100644
--- a/src/Window.cpp
+++ b/src/Window.cpp
@@ -43,4 +43,29 @@ wlr_box CWindow::getFullWindowBoundingBox() {
m_vRealSize.vec().y + maxExtents.topLeft.y + maxExtents.bottomRight.y};
return finalBox;
+}
+
+wlr_box CWindow::getWindowIdealBoundingBoxIgnoreReserved() {
+
+ const auto PMONITOR = g_pCompositor->getMonitorFromID(m_iMonitorID);
+
+ auto POS = m_vPosition;
+ auto SIZE = m_vSize;
+
+ if (DELTALESSTHAN(POS.y - PMONITOR->vecPosition.y, PMONITOR->vecReservedTopLeft.y, 1)) {
+ POS.y = PMONITOR->vecPosition.y;
+ SIZE.y += PMONITOR->vecReservedTopLeft.y;
+ }
+ if (DELTALESSTHAN(POS.x - PMONITOR->vecPosition.x, PMONITOR->vecReservedTopLeft.x, 1)) {
+ POS.x = PMONITOR->vecPosition.x;
+ SIZE.x += PMONITOR->vecReservedTopLeft.x;
+ }
+ if (DELTALESSTHAN(POS.x + SIZE.x - PMONITOR->vecPosition.x, PMONITOR->vecSize.x - PMONITOR->vecReservedBottomRight.x, 1)) {
+ SIZE.x += PMONITOR->vecReservedBottomRight.x;
+ }
+ if (DELTALESSTHAN(POS.y + SIZE.y - PMONITOR->vecPosition.y, PMONITOR->vecSize.y - PMONITOR->vecReservedBottomRight.y, 1)) {
+ SIZE.y += PMONITOR->vecReservedBottomRight.y;
+ }
+
+ return wlr_box{(int)POS.x, (int)POS.y, (int)SIZE.x, (int)SIZE.y};
} \ No newline at end of file