Skip to content

Commit 05242e9

Browse files
committed
Fix minimize and close bugs
refs #8225 To ensure the GUI closes when the "Minimize on close" window option is disabled, and the "Minimize to the tray instead of the taskbar" window option is enbaled, remove a check made against the "Minimize to the tray instead of the taskbar" value, made during GUI closure. To ensure the GUI minimizes to the taskbar when the "Minimize on close" window option is enabled, and the "Minimize to the tray instead of the taskbar" window option is disabled, minimize the GUI and ignore the closure event.
1 parent 6e6ab2c commit 05242e9

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/qt/bitcoingui.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -902,17 +902,22 @@ void BitcoinGUI::closeEvent(QCloseEvent *event)
902902
#ifndef Q_OS_MAC // Ignored on Mac
903903
if(clientModel && clientModel->getOptionsModel())
904904
{
905-
if(!clientModel->getOptionsModel()->getMinimizeToTray() &&
906-
!clientModel->getOptionsModel()->getMinimizeOnClose())
905+
if(!clientModel->getOptionsModel()->getMinimizeOnClose())
907906
{
908907
// close rpcConsole in case it was open to make some space for the shutdown window
909908
rpcConsole->close();
910909

911910
QApplication::quit();
912911
}
912+
else
913+
{
914+
QMainWindow::showMinimized();
915+
event->ignore();
916+
}
913917
}
914-
#endif
918+
#else
915919
QMainWindow::closeEvent(event);
920+
#endif
916921
}
917922

918923
void BitcoinGUI::showEvent(QShowEvent *event)

0 commit comments

Comments
 (0)