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() {
bool recalc = false;
if (!m_bIsMapped || isHidden())
return;
@ -193,8 +192,7 @@ void CWindow::updateWindowDecos() {
for (auto it = m_dWindowDecorations.begin(); it != m_dWindowDecorations.end(); it++) {
if (it->get() == wd) {
g_pDecorationPositioner->uncacheDecoration(it->get());
it = m_dWindowDecorations.erase(it);
recalc = true;
it = m_dWindowDecorations.erase(it);
if (it == m_dWindowDecorations.end())
break;
}
@ -203,9 +201,6 @@ void CWindow::updateWindowDecos() {
g_pDecorationPositioner->onWindowUpdate(m_pSelf.lock());
if (recalc)
g_pLayoutManager->getCurrentLayout()->recalculateWindow(m_pSelf.lock());
m_vDecosToRemove.clear();
// 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}};
g_pLayoutManager->getCurrentLayout()->recalculateWindow(pWindow);
}
void CDecorationPositioner::onWindowUnmap(PHLWINDOW pWindow) {