diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp index 38f4fbfdc0..2a50163e1c 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp @@ -4105,6 +4105,13 @@ void OverlayWidget::hide() { clearBeforeHide(); applyHideWindowWorkaround(); _window->hide(); +#ifdef Q_OS_LINUX + if (Platform::IsWayland()) { + if (const auto handle = _window->windowHandle()) { + handle->destroy(); + } + } +#endif // Q_OS_LINUX } void OverlayWidget::setCursor(style::cursor cursor) {