Skip to content

Commit c8d9d90

Browse files
committed
Fix broken notificator on GNOME
That bug was introduced in #14228.
1 parent f080c65 commit c8d9d90

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/qt/bitcoingui.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const PlatformStyle *_platformSty
130130
if (QSystemTrayIcon::isSystemTrayAvailable()) {
131131
createTrayIcon(networkStyle);
132132
}
133+
notificator = new Notificator(QApplication::applicationName(), trayIcon, this);
133134

134135
// Create status bar
135136
statusBar();
@@ -537,8 +538,7 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel)
537538
unitDisplayControl->setOptionsModel(_clientModel->getOptionsModel());
538539

539540
OptionsModel* optionsModel = _clientModel->getOptionsModel();
540-
if(optionsModel)
541-
{
541+
if (optionsModel && trayIcon) {
542542
// be aware of the tray icon disable state change reported by the OptionsModel object.
543543
connect(optionsModel, &OptionsModel::hideTrayIconChanged, this, &BitcoinGUI::setTrayIconVisible);
544544

@@ -643,14 +643,10 @@ void BitcoinGUI::createTrayIcon(const NetworkStyle *networkStyle)
643643
assert(QSystemTrayIcon::isSystemTrayAvailable());
644644

645645
#ifndef Q_OS_MAC
646-
trayIcon = new QSystemTrayIcon(this);
646+
trayIcon = new QSystemTrayIcon(networkStyle->getTrayAndWindowIcon(), this);
647647
QString toolTip = tr("%1 client").arg(tr(PACKAGE_NAME)) + " " + networkStyle->getTitleAddText();
648648
trayIcon->setToolTip(toolTip);
649-
trayIcon->setIcon(networkStyle->getTrayAndWindowIcon());
650-
trayIcon->hide();
651649
#endif
652-
653-
notificator = new Notificator(QApplication::applicationName(), trayIcon, this);
654650
}
655651

656652
void BitcoinGUI::createTrayIconMenu()

0 commit comments

Comments
 (0)