windowrules/move: clamp max pos in onscreen to avoid assert crash
fixes #10760
This commit is contained in:
parent
1905c41c65
commit
d4e8a44087
1 changed files with 4 additions and 2 deletions
|
|
@ -529,10 +529,12 @@ void Events::listener_mapWindow(void* owner, void* data) {
|
||||||
int borderSize = PWINDOW->getRealBorderSize();
|
int borderSize = PWINDOW->getRealBorderSize();
|
||||||
|
|
||||||
posX = std::clamp(posX, (int)(PMONITOR->m_reservedTopLeft.x + borderSize),
|
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),
|
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);
|
Debug::log(LOG, "Rule move, applying to {}", PWINDOW);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue