summaryrefslogtreecommitdiff
path: root/src/desktop/Window.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2025-12-05 14:16:22 +0000
committerGitHub <noreply@github.com>2025-12-05 14:16:22 +0000
commit9264436f35e2c4e94adfdf2a8ea23a346ace3a65 (patch)
tree9fe48ff4728060445e655d8a3b528999fd124ff8 /src/desktop/Window.cpp
parentd5c52ef58e57b371a9df8fd4404c5d55a1b26f34 (diff)
desktop: rewrite reserved area handling + improve tests (#12383)
Diffstat (limited to 'src/desktop/Window.cpp')
-rw-r--r--src/desktop/Window.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/desktop/Window.cpp b/src/desktop/Window.cpp
index 8a0e37a6..75dc7215 100644
--- a/src/desktop/Window.cpp
+++ b/src/desktop/Window.cpp
@@ -229,19 +229,19 @@ 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_reservedTopLeft.y, 1)) {
+ if (DELTALESSTHAN(POS.y - PMONITOR->m_position.y, PMONITOR->m_reservedArea.top(), 1)) {
POS.y = PMONITOR->m_position.y;
- SIZE.y += PMONITOR->m_reservedTopLeft.y;
+ SIZE.y += PMONITOR->m_reservedArea.top();
}
- if (DELTALESSTHAN(POS.x - PMONITOR->m_position.x, PMONITOR->m_reservedTopLeft.x, 1)) {
+ if (DELTALESSTHAN(POS.x - PMONITOR->m_position.x, PMONITOR->m_reservedArea.left(), 1)) {
POS.x = PMONITOR->m_position.x;
- SIZE.x += PMONITOR->m_reservedTopLeft.x;
+ SIZE.x += PMONITOR->m_reservedArea.left();
}
- if (DELTALESSTHAN(POS.x + SIZE.x - PMONITOR->m_position.x, PMONITOR->m_size.x - PMONITOR->m_reservedBottomRight.x, 1)) {
- SIZE.x += PMONITOR->m_reservedBottomRight.x;
+ 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_reservedBottomRight.y, 1)) {
- SIZE.y += PMONITOR->m_reservedBottomRight.y;
+ 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();
}
return CBox{sc<int>(POS.x), sc<int>(POS.y), sc<int>(SIZE.x), sc<int>(SIZE.y)};