diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp index a8359f7f0e..b77a511aaf 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp @@ -3491,9 +3491,9 @@ void OverlayWidget::setVisibleHook(bool visible) { // QOpenGLWidget can't properly destroy a child widget if // it is hidden exactly after that, so it must be repainted // before it is hidden without the child widget. - if (!isHidden() && _streamed) { - _streamed->controls.hide(); + if (!isHidden()) { _dropdown->hideFast(); + hideChildren(); _wasRepainted = false; repaint(); if (!_wasRepainted) { diff --git a/Telegram/SourceFiles/ui/twidget.h b/Telegram/SourceFiles/ui/twidget.h index 93853a446a..ef79a5fd88 100644 --- a/Telegram/SourceFiles/ui/twidget.h +++ b/Telegram/SourceFiles/ui/twidget.h @@ -238,6 +238,25 @@ public: return QMargins(); } + bool inFocusChain() const { + return Ui::InFocusChain(this); + } + + void hideChildren() { + for (auto child : Base::children()) { + if (child->isWidgetType()) { + static_cast(child)->hide(); + } + } + } + void showChildren() { + for (auto child : Base::children()) { + if (child->isWidgetType()) { + static_cast(child)->show(); + } + } + } + void moveToLeft(int x, int y, int outerw = 0) { auto margins = getMargins(); x -= margins.left(); @@ -348,25 +367,6 @@ public: TWidget(QWidget *parent = nullptr) : TWidgetHelper(parent) { } - bool inFocusChain() const { - return Ui::InFocusChain(this); - } - - void hideChildren() { - for (auto child : children()) { - if (child->isWidgetType()) { - static_cast(child)->hide(); - } - } - } - void showChildren() { - for (auto child : children()) { - if (child->isWidgetType()) { - static_cast(child)->show(); - } - } - } - // Get the size of the widget as it should be. // Negative return value means no default width. virtual int naturalWidth() const {