diff options
Diffstat (limited to 'src/qt')
-rw-r--r-- | src/qt/bitcoin.cpp | 13 | ||||
-rw-r--r-- | src/qt/bitcoingui.h | 5 |
2 files changed, 11 insertions, 7 deletions
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index cf1bc6450e..6e08dae3c4 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -392,14 +392,13 @@ void BitcoinApplication::initializeResult(bool success) } #endif - // If -min option passed, start window minimized. - if(gArgs.GetBoolArg("-min", false)) - { - window->showMinimized(); - } - else - { + // If -min option passed, start window minimized (iconified) or minimized to tray + if (!gArgs.GetBoolArg("-min", false)) { window->show(); + } else if (clientModel->getOptionsModel()->getMinimizeToTray() && window->hasTrayIcon()) { + // do nothing as the window is managed by the tray icon + } else { + window->showMinimized(); } Q_EMIT splashFinished(); Q_EMIT windowShown(window); diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index e6c62d43bd..9ca9e4c926 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -86,6 +86,11 @@ public: #endif // ENABLE_WALLET bool enableWallet = false; + /** Get the tray icon status. + Some systems have not "system tray" or "notification area" available. + */ + bool hasTrayIcon() const { return trayIcon; } + protected: void changeEvent(QEvent *e); void closeEvent(QCloseEvent *event); |