# # # patch "src/GuitoneStandalone.cpp" # from [bfa5211804f8915d4982afd17931de3785498ccf] # to [d87407ee689bb9f728653210982691911192364e] # ============================================================ --- src/GuitoneStandalone.cpp bfa5211804f8915d4982afd17931de3785498ccf +++ src/GuitoneStandalone.cpp d87407ee689bb9f728653210982691911192364e @@ -156,6 +156,21 @@ bool GuitoneStandalone::event(QEvent * e eaten = true; break; } +#ifdef Q_WS_MAC: + // I'm not sure if this is a bug in Qt or a bug in my code, but + // if you click on "Quit" in the application menu in the dock, + // Qt receives a Close event on the application, not on the widget + // and completly ignores that. (Close events are only documented on + // widgets, _not_ the application!) Calling quit() here directly will + // at first close all windows (see our quit() implementation above) + // and then call quit() again, so we just close all windos here + // and, oh magic, even though quitOnLastWindowClose is set to false + // Qt magically ends the event loop as well! + case QEvent::Close: + { + eaten = closeAllWindows(); + } +#endif default: eaten = QCoreApplication::event(ev); break;