Avoid clipping hidden windows (fix #4546)

This commit is contained in:
Martín Capello 2024-11-15 10:12:25 -03:00 committed by David Capello
parent 9eadd740b8
commit f76bbcff67
2 changed files with 11 additions and 4 deletions

View File

@ -2051,10 +2051,12 @@ void Manager::onInvalidateRegion(const gfx::Region& region)
break; // Work done break; // Work done
} }
// Clip this window area for the next window. // Clip this window area for the next window, only if not hidden.
gfx::Region reg2; if (!window->hasFlags(HIDDEN)) {
window->getRegion(reg2); gfx::Region reg2;
reg1.createSubtraction(reg1, reg2); window->getRegion(reg2);
reg1.createSubtraction(reg1, reg2);
}
} }
// Invalidate areas outside windows (only when there are not a // Invalidate areas outside windows (only when there are not a

View File

@ -232,6 +232,11 @@ void Widget::setVisible(bool state)
man->freeWidget(this); // Free from manager man->freeWidget(this); // Free from manager
enableFlags(HIDDEN); enableFlags(HIDDEN);
// As this widget was hidden we need to invalidate the area it was
// occupying
if (auto man = manager())
man->invalidateRect(bounds());
onVisible(false); onVisible(false);
} }
} }