From d353e110776dee0e54398944abd12bec71961e7d Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Thu, 16 Jun 2022 11:13:33 +0400 Subject: [PATCH] Ensure reActivateWindow is used only on X11 --- Telegram/SourceFiles/window/main_window.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/window/main_window.cpp b/Telegram/SourceFiles/window/main_window.cpp index ebe0977bbb..cf98ca731c 100644 --- a/Telegram/SourceFiles/window/main_window.cpp +++ b/Telegram/SourceFiles/window/main_window.cpp @@ -914,7 +914,10 @@ bool MainWindow::minimizeToTray() { } void MainWindow::reActivateWindow() { -#if defined Q_OS_UNIX && !defined Q_OS_MAC + // X11 is the only platform with unreliable activate requests + if (!Platform::IsX11()) { + return; + } const auto weak = Ui::MakeWeak(this); const auto reActivate = [=] { if (const auto w = weak.data()) { @@ -930,7 +933,6 @@ void MainWindow::reActivateWindow() { }; crl::on_main(this, reActivate); base::call_delayed(200, this, reActivate); -#endif // Q_OS_UNIX && !Q_OS_MAC } void MainWindow::showRightColumn(object_ptr widget) {