diff --git a/src/ui/manager.cpp b/src/ui/manager.cpp index 444b00452..16b41bec2 100644 --- a/src/ui/manager.cpp +++ b/src/ui/manager.cpp @@ -2051,10 +2051,12 @@ void Manager::onInvalidateRegion(const gfx::Region& region) break; // Work done } - // Clip this window area for the next window. - gfx::Region reg2; - window->getRegion(reg2); - reg1.createSubtraction(reg1, reg2); + // Clip this window area for the next window, only if not hidden. + if (!window->hasFlags(HIDDEN)) { + gfx::Region reg2; + window->getRegion(reg2); + reg1.createSubtraction(reg1, reg2); + } } // Invalidate areas outside windows (only when there are not a diff --git a/src/ui/widget.cpp b/src/ui/widget.cpp index fcb749937..cdfc58335 100644 --- a/src/ui/widget.cpp +++ b/src/ui/widget.cpp @@ -232,6 +232,11 @@ void Widget::setVisible(bool state) man->freeWidget(this); // Free from manager 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); } }