From 28719939a0b37111107e0a64edd615ac69cf1108 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 13 Oct 2019 15:30:52 +0400 Subject: [PATCH] Fix tray icon on macOS in Qt 5.12.5. --- Telegram/SourceFiles/mainwindow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/mainwindow.cpp b/Telegram/SourceFiles/mainwindow.cpp index ef8fcf6db..24e641e7f 100644 --- a/Telegram/SourceFiles/mainwindow.cpp +++ b/Telegram/SourceFiles/mainwindow.cpp @@ -578,7 +578,7 @@ void MainWindow::updateTrayMenu(bool force) { // On macOS just remove trayIcon menu if the window is not active. // So we will activate the window on click instead of showing the menu. - if (!active && Platform::IsMac() && false) { // #TODO 5.12.5 + if (!active && Platform::IsMac()) { iconMenu = nullptr; } } @@ -703,6 +703,9 @@ void MainWindow::handleTrayIconActication( QSystemTrayIcon::ActivationReason reason) { updateIsActive(0); if (Platform::IsMac() && isActive()) { + if (trayIcon && !trayIcon->contextMenu()) { + showFromTray(reason); + } return; } if (reason == QSystemTrayIcon::Context) {