fix: ignore reserved in getWindowInDirection
This commit is contained in:
parent
ae60075226
commit
f76b9c4852
3 changed files with 36 additions and 4 deletions
|
|
@ -43,4 +43,29 @@ wlr_box CWindow::getFullWindowBoundingBox() {
|
|||
m_vRealSize.vec().y + maxExtents.topLeft.y + maxExtents.bottomRight.y};
|
||||
|
||||
return finalBox;
|
||||
}
|
||||
|
||||
wlr_box CWindow::getWindowIdealBoundingBoxIgnoreReserved() {
|
||||
|
||||
const auto PMONITOR = g_pCompositor->getMonitorFromID(m_iMonitorID);
|
||||
|
||||
auto POS = m_vPosition;
|
||||
auto SIZE = m_vSize;
|
||||
|
||||
if (DELTALESSTHAN(POS.y - PMONITOR->vecPosition.y, PMONITOR->vecReservedTopLeft.y, 1)) {
|
||||
POS.y = PMONITOR->vecPosition.y;
|
||||
SIZE.y += PMONITOR->vecReservedTopLeft.y;
|
||||
}
|
||||
if (DELTALESSTHAN(POS.x - PMONITOR->vecPosition.x, PMONITOR->vecReservedTopLeft.x, 1)) {
|
||||
POS.x = PMONITOR->vecPosition.x;
|
||||
SIZE.x += PMONITOR->vecReservedTopLeft.x;
|
||||
}
|
||||
if (DELTALESSTHAN(POS.x + SIZE.x - PMONITOR->vecPosition.x, PMONITOR->vecSize.x - PMONITOR->vecReservedBottomRight.x, 1)) {
|
||||
SIZE.x += PMONITOR->vecReservedBottomRight.x;
|
||||
}
|
||||
if (DELTALESSTHAN(POS.y + SIZE.y - PMONITOR->vecPosition.y, PMONITOR->vecSize.y - PMONITOR->vecReservedBottomRight.y, 1)) {
|
||||
SIZE.y += PMONITOR->vecReservedBottomRight.y;
|
||||
}
|
||||
|
||||
return wlr_box{(int)POS.x, (int)POS.y, (int)SIZE.x, (int)SIZE.y};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue