Skip to content

Commit

Permalink
layout: Trigger layout recalcuation on deco position/size change (#5821)
Browse files Browse the repository at this point in the history
* Trigger layout recalcuation on deco position/size change

* Remove now unneeded code

* Formatting
  • Loading branch information
zakk4223 authored May 1, 2024
1 parent ed58cc4 commit d2899a6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
7 changes: 1 addition & 6 deletions src/desktop/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ SWindowDecorationExtents CWindow::getFullWindowReservedArea() {
}

void CWindow::updateWindowDecos() {
bool recalc = false;

if (!m_bIsMapped || isHidden())
return;
Expand All @@ -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;
}
Expand All @@ -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.
Expand Down
1 change: 1 addition & 0 deletions src/render/decorations/DecorationPositioner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit d2899a6

Please sign in to comment.