diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2018-11-12 15:07:17 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2018-11-12 15:08:06 +0100 |
commit | 5cdfd72b179d91ce4db085375fd6cdfa3cbd9d41 (patch) | |
tree | 0b1421de25251638d7cf87b94e41795cb2a692c6 /src/qt/bitcoingui.cpp | |
parent | af3c8a7e9f09e3da2e7fc656d1586540209ce858 (diff) | |
parent | ec1201a36847f7aa942eab1b3a3d082f6daf0031 (diff) |
Merge #14228: Qt: Enable system tray icon by default if available
ec1201a36847f7aa942eab1b3a3d082f6daf0031 Don't use systray icon on inappropriate systems (Hennadii Stepanov)
Pull request description:
Prevent a user from losing access to the main window by minimizing it to the tray on the systems which have not “system tray” or “notification area” available (e.g. GNOME 3.26+).
Tested on Fedora 28 + GNOME 3.28.
Tree-SHA512: c2dc26ff31c38a882dbd7d1ff71af99f1ba38a04a1c8b7fe7b99b93e4c0719f2916c7db0e620806a36582402d18939c635e1913c276b452ecbf939936067407b
Diffstat (limited to 'src/qt/bitcoingui.cpp')
-rw-r--r-- | src/qt/bitcoingui.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 8c4a37fee5..ef82351551 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -127,7 +127,9 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const PlatformStyle *_platformSty createToolBars(); // Create system tray icon and notification - createTrayIcon(networkStyle); + if (QSystemTrayIcon::isSystemTrayAvailable()) { + createTrayIcon(networkStyle); + } // Create status bar statusBar(); @@ -588,6 +590,8 @@ void BitcoinGUI::setWalletActionsEnabled(bool enabled) void BitcoinGUI::createTrayIcon(const NetworkStyle *networkStyle) { + assert(QSystemTrayIcon::isSystemTrayAvailable()); + #ifndef Q_OS_MAC trayIcon = new QSystemTrayIcon(this); QString toolTip = tr("%1 client").arg(tr(PACKAGE_NAME)) + " " + networkStyle->getTitleAddText(); |