Skip to content

Commit 49d5712

Browse files
committed
qt: Ignore showNormalIfMinimized in initialization or shutdown
Also get rid of ui_interface flag NOSHOWGUI. It's up to the GUI to decide this. Fixes #4360.
1 parent c9bc398 commit 49d5712

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

src/init.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,13 +179,13 @@ void HandleSIGHUP(int)
179179

180180
bool static InitError(const std::string &str)
181181
{
182-
uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_ERROR | CClientUIInterface::NOSHOWGUI);
182+
uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_ERROR);
183183
return false;
184184
}
185185

186186
bool static InitWarning(const std::string &str)
187187
{
188-
uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_WARNING | CClientUIInterface::NOSHOWGUI);
188+
uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_WARNING);
189189
return true;
190190
}
191191

src/qt/bitcoingui.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -780,11 +780,7 @@ void BitcoinGUI::message(const QString &title, const QString &message, unsigned
780780
if (!(buttons = (QMessageBox::StandardButton)(style & CClientUIInterface::BTN_MASK)))
781781
buttons = QMessageBox::Ok;
782782

783-
// Ensure we get users attention, but only if main window is visible
784-
// as we don't want to pop up the main window for messages that happen before
785-
// initialization is finished.
786-
if(!(style & CClientUIInterface::NOSHOWGUI))
787-
showNormalIfMinimized();
783+
showNormalIfMinimized();
788784
QMessageBox mBox((QMessageBox::Icon)nMBoxIcon, strTitle, message, buttons, this);
789785
int r = mBox.exec();
790786
if (ret != NULL)
@@ -921,6 +917,8 @@ void BitcoinGUI::setEncryptionStatus(int status)
921917

922918
void BitcoinGUI::showNormalIfMinimized(bool fToggleHidden)
923919
{
920+
if(!clientModel)
921+
return;
924922
// activateWindow() (sometimes) helps with keyboard focus on Windows
925923
if (isHidden())
926924
{

src/ui_interface.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ class CClientUIInterface
6363

6464
/** Force blocking, modal message box dialog (not just OS notification) */
6565
MODAL = 0x10000000U,
66-
/** Don't bring GUI to foreground. Use for messages during initialization */
67-
NOSHOWGUI = 0x20000000U,
6866

6967
/** Predefined combinations for certain default usage cases */
7068
MSG_INFORMATION = ICON_INFORMATION,

0 commit comments

Comments
 (0)