Fix start with the -min option

When GUI starts with the `-min` option, the `Minimize to tray instead of
the taskbar` option works as expected now.
This commit is contained in:
Hennadii Stepanov 2018-10-19 10:39:25 +03:00
parent d387507aec
commit 93009618b6
No known key found for this signature in database
GPG key ID: 410108112E7EA81F
2 changed files with 11 additions and 7 deletions

View file

@ -487,14 +487,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(window);

View file

@ -82,6 +82,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);