layout: Trigger layout recalcuation on deco position/size change (#5821)

* Trigger layout recalcuation on deco position/size change

* Remove now unneeded code

* Formatting
This commit is contained in:
zakk4223 2024-05-01 07:59:40 -04:00 committed by GitHub
parent ed58cc4c31
commit d2899a6c27
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 6 deletions

View file

@ -184,7 +184,6 @@ SWindowDecorationExtents CWindow::getFullWindowReservedArea() {
} }
void CWindow::updateWindowDecos() { void CWindow::updateWindowDecos() {
bool recalc = false;
if (!m_bIsMapped || isHidden()) if (!m_bIsMapped || isHidden())
return; return;
@ -194,7 +193,6 @@ void CWindow::updateWindowDecos() {
if (it->get() == wd) { if (it->get() == wd) {
g_pDecorationPositioner->uncacheDecoration(it->get()); g_pDecorationPositioner->uncacheDecoration(it->get());
it = m_dWindowDecorations.erase(it); it = m_dWindowDecorations.erase(it);
recalc = true;
if (it == m_dWindowDecorations.end()) if (it == m_dWindowDecorations.end())
break; break;
} }
@ -203,9 +201,6 @@ void CWindow::updateWindowDecos() {
g_pDecorationPositioner->onWindowUpdate(m_pSelf.lock()); g_pDecorationPositioner->onWindowUpdate(m_pSelf.lock());
if (recalc)
g_pLayoutManager->getCurrentLayout()->recalculateWindow(m_pSelf.lock());
m_vDecosToRemove.clear(); m_vDecosToRemove.clear();
// make a copy because updateWindow can remove decos. // make a copy because updateWindow can remove decos.

View file

@ -267,6 +267,7 @@ void CDecorationPositioner::onWindowUpdate(PHLWINDOW pWindow) {
} }
WINDOWDATA->extents = {{stickyOffsetXL + reservedXL, stickyOffsetYT + reservedYT}, {stickyOffsetXR + reservedXR, stickyOffsetYB + reservedYB}}; WINDOWDATA->extents = {{stickyOffsetXL + reservedXL, stickyOffsetYT + reservedYT}, {stickyOffsetXR + reservedXR, stickyOffsetYB + reservedYB}};
g_pLayoutManager->getCurrentLayout()->recalculateWindow(pWindow);
} }
void CDecorationPositioner::onWindowUnmap(PHLWINDOW pWindow) { void CDecorationPositioner::onWindowUnmap(PHLWINDOW pWindow) {