From 245d644cd7dd3c00e4bf9e380c6d60342d5c7141 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Mon, 19 Oct 2020 01:55:52 +0400 Subject: [PATCH] Add always on top hint for media view window To avoid overlapping by panels in KDE --- .../media/view/media_view_overlay_widget.cpp | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp index 692386237d..fd2088e9b8 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp @@ -345,11 +345,13 @@ OverlayWidget::OverlayWidget() connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(onScreenResized(int))); -#if defined Q_OS_UNIX && !defined Q_OS_MAC - setWindowFlags(Qt::FramelessWindowHint | Qt::MaximizeUsingFullscreenGeometryHint); -#else // Q_OS_UNIX && !Q_OS_MAC - setWindowFlags(Qt::FramelessWindowHint); -#endif // Q_OS_UNIX && !Q_OS_MAC + if (Platform::IsLinux()) { + setWindowFlags(Qt::FramelessWindowHint + | Qt::WindowStaysOnTopHint + | Qt::MaximizeUsingFullscreenGeometryHint); + } else { + setWindowFlags(Qt::FramelessWindowHint); + } moveToScreen(); setAttribute(Qt::WA_NoSystemBackground, true); setAttribute(Qt::WA_TranslucentBackground, true); @@ -2280,11 +2282,11 @@ void OverlayWidget::displayFinished() { updateControls(); if (isHidden()) { Ui::Platform::UpdateOverlayed(this); -#if defined Q_OS_UNIX && !defined Q_OS_MAC - showFullScreen(); -#else // Q_OS_UNIX && !Q_OS_MAC - show(); -#endif // Q_OS_UNIX && !Q_OS_MAC + if (Platform::IsLinux()) { + showFullScreen(); + } else { + show(); + } Ui::Platform::ShowOverAll(this); activateWindow(); QApplication::setActiveWindow(this);