@@ -818,16 +818,26 @@ void BitcoinGUI::createTrayIconMenu()
818818 // Using QSystemTrayIcon::Context is not reliable.
819819 // See https://bugreports.qt.io/browse/QTBUG-91697
820820 trayIconMenu.get (), &QMenu::aboutToShow,
821- [this , show_hide_action, send_action, receive_action, sign_action, verify_action] {
821+ [this , show_hide_action, send_action, receive_action, sign_action, verify_action, options_action, node_window_action, quit_action ] {
822822 if (show_hide_action) show_hide_action->setText (
823823 (!isHidden () && !isMinimized () && !GUIUtil::isObscured (this )) ?
824824 tr (" &Hide" ) :
825825 tr (" S&how" ));
826- if (enableWallet) {
827- send_action->setEnabled (sendCoinsAction->isEnabled ());
828- receive_action->setEnabled (receiveCoinsAction->isEnabled ());
829- sign_action->setEnabled (signMessageAction->isEnabled ());
830- verify_action->setEnabled (verifyMessageAction->isEnabled ());
826+ if (QApplication::activeModalWidget ()) {
827+ for (QAction* a : trayIconMenu.get ()->actions ()) {
828+ a->setEnabled (false );
829+ }
830+ } else {
831+ if (show_hide_action) show_hide_action->setEnabled (true );
832+ if (enableWallet) {
833+ send_action->setEnabled (sendCoinsAction->isEnabled ());
834+ receive_action->setEnabled (receiveCoinsAction->isEnabled ());
835+ sign_action->setEnabled (signMessageAction->isEnabled ());
836+ verify_action->setEnabled (verifyMessageAction->isEnabled ());
837+ }
838+ options_action->setEnabled (optionsAction->isEnabled ());
839+ node_window_action->setEnabled (openRPCConsoleAction->isEnabled ());
840+ if (quit_action) quit_action->setEnabled (true );
831841 }
832842 });
833843}
0 commit comments