summaryrefslogtreecommitdiff
path: root/src/desktop/view/Window.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2026-01-01 16:48:23 +0100
committerGitHub <noreply@github.com>2026-01-01 16:48:23 +0100
commit9b93d621b1019e8378b8a902edb7ba8dd8baf204 (patch)
tree0d13786ba53a7ce272897ba48cc560303f0dc306 /src/desktop/view/Window.cpp
parentbd7f9aad053866d5ca07195a79c1c7a1b060a8c1 (diff)
desktop/window: use workArea for idealBB (#12802)
Diffstat (limited to 'src/desktop/view/Window.cpp')
-rw-r--r--src/desktop/view/Window.cpp26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/desktop/view/Window.cpp b/src/desktop/view/Window.cpp
index b0e6a365..3031284c 100644
--- a/src/desktop/view/Window.cpp
+++ b/src/desktop/view/Window.cpp
@@ -246,7 +246,7 @@ CBox CWindow::getFullWindowBoundingBox() const {
CBox CWindow::getWindowIdealBoundingBoxIgnoreReserved() {
const auto PMONITOR = m_monitor.lock();
- if (!PMONITOR)
+ if (!PMONITOR || !m_workspace)
return {m_position, m_size};
auto POS = m_position;
@@ -259,21 +259,25 @@ CBox CWindow::getWindowIdealBoundingBoxIgnoreReserved() {
return CBox{sc<int>(POS.x), sc<int>(POS.y), sc<int>(SIZE.x), sc<int>(SIZE.y)};
}
- if (DELTALESSTHAN(POS.y - PMONITOR->m_position.y, PMONITOR->m_reservedArea.top(), 1)) {
+ // get work area
+ const auto WORKAREA = g_pLayoutManager->getCurrentLayout()->workAreaOnWorkspace(m_workspace);
+ const auto RESERVED = CReservedArea{PMONITOR->logicalBox(), WORKAREA};
+
+ if (DELTALESSTHAN(POS.y - PMONITOR->m_position.y, RESERVED.top(), 1)) {
POS.y = PMONITOR->m_position.y;
- SIZE.y += PMONITOR->m_reservedArea.top();
+ SIZE.y += RESERVED.top();
}
- if (DELTALESSTHAN(POS.x - PMONITOR->m_position.x, PMONITOR->m_reservedArea.left(), 1)) {
+ if (DELTALESSTHAN(POS.x - PMONITOR->m_position.x, RESERVED.left(), 1)) {
POS.x = PMONITOR->m_position.x;
- SIZE.x += PMONITOR->m_reservedArea.left();
- }
- if (DELTALESSTHAN(POS.x + SIZE.x - PMONITOR->m_position.x, PMONITOR->m_size.x - PMONITOR->m_reservedArea.right(), 1)) {
- SIZE.x += PMONITOR->m_reservedArea.right();
- }
- if (DELTALESSTHAN(POS.y + SIZE.y - PMONITOR->m_position.y, PMONITOR->m_size.y - PMONITOR->m_reservedArea.bottom(), 1)) {
- SIZE.y += PMONITOR->m_reservedArea.bottom();
+ SIZE.x += RESERVED.left();
}
+ if (DELTALESSTHAN(POS.x + SIZE.x - PMONITOR->m_position.x, PMONITOR->m_size.x - RESERVED.right(), 1))
+ SIZE.x += RESERVED.right();
+
+ if (DELTALESSTHAN(POS.y + SIZE.y - PMONITOR->m_position.y, PMONITOR->m_size.y - RESERVED.bottom(), 1))
+ SIZE.y += RESERVED.bottom();
+
return CBox{sc<int>(POS.x), sc<int>(POS.y), sc<int>(SIZE.x), sc<int>(SIZE.y)};
}