From 5c8db3bb91f7183a3ab3d04465c5e5ce265ee845 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Mon, 6 Jul 2026 23:39:11 -0700 Subject: [PATCH] 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. --- od-unix/qt/launcher.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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); -- 2.47.3