From: Stefan Reinauer Date: Tue, 7 Jul 2026 06:39:11 +0000 (-0700) Subject: qt: let Cmd+Q close the launcher on macOS X-Git-Url: https://gitweb.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=5c8db3bb91f7183a3ab3d04465c5e5ce265ee845;p=francis%2Fwinuae.git qt: let Cmd+Q close the launcher on macOS The launcher runs as a modal QDialog::exec() with no application event loop and no menu bar. Escape works because QDialog maps it to reject() internally, but macOS disables the auto-generated application menu (and its Cmd+Q) while a modal session is active, so Cmd+Q was swallowed by the OS and never closed the dialog. Bind QKeySequence::Quit directly on the dialog so it is handled inside the modal loop, mirroring Escape. --- diff --git a/od-unix/qt/launcher.cpp b/od-unix/qt/launcher.cpp index 924cecc8..8b7c0d00 100644 --- a/od-unix/qt/launcher.cpp +++ b/od-unix/qt/launcher.cpp @@ -5434,6 +5434,12 @@ public: connect(start, &QPushButton::clicked, this, [this]() { startEmulator(); }); connect(help, &QPushButton::clicked, this, [this]() { openHelp(); }); + // macOS disables the application menu (and its Cmd+Q) while the launcher + // runs as a modal dialog, so Cmd+Q never reaches us the way it would in + // a normal app. Bind it explicitly to Cancel, mirroring Escape. + QShortcut *quitShortcut = new QShortcut(QKeySequence::Quit, this); + connect(quitShortcut, &QShortcut::activated, this, &QDialog::reject); + QHBoxLayout *buttons = new QHBoxLayout; buttons->setContentsMargins(0, 0, 0, 0); buttons->addWidget(reset);