summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2025-06-16 13:42:58 +0200
committerVaxry <vaxry@vaxry.net>2025-06-16 13:43:06 +0200
commitd4e8a440874bebed07a5908009a3d854120277ed (patch)
treec6c90d2b382061328dcc7f604a1de1cfdc7240ea /src
parent1905c41c65f9aabc06eca3089c898aac29971e32 (diff)
windowrules/move: clamp max pos in onscreen to avoid assert crash
fixes #10760
Diffstat (limited to 'src')
-rw-r--r--src/events/Windows.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp
index d9408dbd..3636706d 100644
--- a/src/events/Windows.cpp
+++ b/src/events/Windows.cpp
@@ -529,10 +529,12 @@ void Events::listener_mapWindow(void* owner, void* data) {
int borderSize = PWINDOW->getRealBorderSize();
posX = std::clamp(posX, (int)(PMONITOR->m_reservedTopLeft.x + borderSize),
- (int)(PMONITOR->m_size.x - PMONITOR->m_reservedBottomRight.x - PWINDOW->m_realSize->goal().x - borderSize));
+ std::max((int)(PMONITOR->m_size.x - PMONITOR->m_reservedBottomRight.x - PWINDOW->m_realSize->goal().x - borderSize),
+ (int)(PMONITOR->m_reservedTopLeft.x + borderSize + 1)));
posY = std::clamp(posY, (int)(PMONITOR->m_reservedTopLeft.y + borderSize),
- (int)(PMONITOR->m_size.y - PMONITOR->m_reservedBottomRight.y - PWINDOW->m_realSize->goal().y - borderSize));
+ std::max((int)(PMONITOR->m_size.y - PMONITOR->m_reservedBottomRight.y - PWINDOW->m_realSize->goal().y - borderSize),
+ (int)(PMONITOR->m_reservedTopLeft.y + borderSize + 1)));
}
Debug::log(LOG, "Rule move, applying to {}", PWINDOW);