From 3ebcb78e12bfb404404b1dc3c10d3513f3270776 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Mon, 5 Dec 2016 00:33:23 +0400 Subject: [PATCH] do not conect trayIconActivated on mac (#1184) --- src/qt/bitcoingui.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 62ab14fde..22b38f31d 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -580,14 +580,16 @@ void BitcoinGUI::setClientModel(ClientModel *clientModel) // do so only if trayIcon is already set trayIconMenu = new QMenu(this); trayIcon->setContextMenu(trayIconMenu); - - connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), - this, SLOT(trayIconActivated(QSystemTrayIcon::ActivationReason))); - createIconMenu(trayIconMenu); -#ifdef Q_OS_MAC - // Note: On Mac, the dock icon is also used to provide same functionality. +#ifndef Q_OS_MAC + // Show main window on tray icon click + // Note: ignore this on Mac - this is not the way tray should work there + connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), + this, SLOT(trayIconActivated(QSystemTrayIcon::ActivationReason))); +#else + // Note: On Mac, the dock icon is also used to provide menu functionality + // similar to one for tray icon MacDockIconHandler *dockIconHandler = MacDockIconHandler::instance(); dockIconHandler->setMainWindow((QMainWindow *)this); dockIconMenu = dockIconHandler->dockMenu();