diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp index 277538cad..350590a0d 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp @@ -492,6 +492,15 @@ OverlayWidget::OverlayWidget() return base::EventFilterResult::Cancel; } else if (type == QEvent::ThemeChange && Platform::IsLinux()) { _window->setWindowIcon(Window::CreateIcon(_session)); + } else if (type == QEvent::ContextMenu) { + const auto event = static_cast(e.get()); + const auto mouse = (event->reason() == QContextMenuEvent::Mouse); + const auto position = mouse + ? std::make_optional(event->pos()) + : std::nullopt; + if (handleContextMenu(position)) { + return base::EventFilterResult::Cancel; + } } return base::EventFilterResult::Continue; });