From b5aa043cc394462ff809e0675cd22072cdc14421 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Thu, 21 May 2026 21:33:41 +0300 Subject: [PATCH] Added destruction of media viewer native window on hide for Wayland. --- .../SourceFiles/media/view/media_view_overlay_widget.cpp | 7 +++++++ 1 file changed, 7 insertions(+) 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) {