diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp index 9ee7762..be685cf 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp @@ -772,6 +772,10 @@ OverlayWidget::OverlayWidget() if (handleContextMenu(position)) { return base::EventFilterResult::Cancel; } + } else if (type == QEvent::KeyPress) { + handleKeyPress(static_cast(e.get())); + } else if (type == QEvent::KeyRelease) { + handleKeyRelease(static_cast(e.get())); } else if (e->type() == QEvent::WindowStateChange) { const auto state = window()->windowState(); if (state == Qt::WindowMinimized || Platform::IsMac()) { @@ -816,10 +820,6 @@ OverlayWidget::OverlayWidget() _widget->setGeometry({ QPoint(), size }); updateControlsGeometry(); - } else if (type == QEvent::KeyPress) { - handleKeyPress(static_cast(e.get())); - } else if (type == QEvent::KeyRelease) { - handleKeyRelease(static_cast(e.get())); } return base::EventFilterResult::Continue; });