summaryrefslogtreecommitdiff
path: root/src/Window.cpp
diff options
context:
space:
mode:
authorvaxerski <vaxry@vaxry.net>2023-08-09 14:28:04 +0200
committervaxerski <vaxry@vaxry.net>2023-08-09 14:28:04 +0200
commitd7209b90bb8d866a641a49f815481fa9bc323105 (patch)
tree82b1863ac05c0643384bbbad26cfbdb0be1cef06 /src/Window.cpp
parent47430411d69d6cba9241775f0ea11722afeb74d7 (diff)
renderer: remember extents before removing a window and use them for dt
fixes #2351
Diffstat (limited to 'src/Window.cpp')
-rw-r--r--src/Window.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/Window.cpp b/src/Window.cpp
index f48d27f1..63c5a79e 100644
--- a/src/Window.cpp
+++ b/src/Window.cpp
@@ -22,7 +22,10 @@ CWindow::~CWindow() {
}
}
-wlr_box CWindow::getFullWindowBoundingBox() {
+SWindowDecorationExtents CWindow::getFullWindowExtents() {
+ if (m_bFadingOut)
+ return m_eOriginalClosedExtents;
+
static auto* const PBORDERSIZE = &g_pConfigManager->getConfigValuePtr("general:border_size")->intValue;
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(m_iWorkspaceID);
@@ -37,7 +40,8 @@ wlr_box CWindow::getFullWindowBoundingBox() {
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};
+ return {{m_vRealPosition.vec().x - PMONITOR->vecPosition.x, m_vRealPosition.vec().y - PMONITOR->vecPosition.y},
+ {PMONITOR->vecSize.x - (m_vRealPosition.vec().x - PMONITOR->vecPosition.x), PMONITOR->vecSize.y - (m_vRealPosition.vec().y - PMONITOR->vecPosition.y)}};
}
SWindowDecorationExtents maxExtents = {{borderSize + 2, borderSize + 2}, {borderSize + 2, borderSize + 2}};
@@ -90,7 +94,17 @@ wlr_box CWindow::getFullWindowBoundingBox() {
maxExtents.bottomRight.y = surfaceExtents.y + surfaceExtents.height - m_pWLSurface.wlr()->current.height;
}
- // Add extents to the real base BB and return
+ return maxExtents;
+}
+
+wlr_box CWindow::getFullWindowBoundingBox() {
+ 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};
+ }
+
+ auto maxExtents = getFullWindowExtents();
+
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};