diff --git a/CHANGES b/CHANGES index 246bdec53..6e3e90581 100644 --- a/CHANGES +++ b/CHANGES @@ -21,6 +21,7 @@ Other fixes: - Qt: Fix infrequent deadlock when using sync to video - Qt: Fix applying savetype-only overrides - Qt: Fix crash in sprite view for partially out-of-bounds sprites (fixes mgba.io/i/2165) + - Qt: Fix having to press controller buttons twice for menu items (fixes mgba.io/i/2143) - Util: Fix loading UPS patches that affect the last byte of the file Misc: - Core: Suspend runloop when a core crashes diff --git a/src/platform/qt/ActionMapper.cpp b/src/platform/qt/ActionMapper.cpp index bdd2065cc..a0d80a0d1 100644 --- a/src/platform/qt/ActionMapper.cpp +++ b/src/platform/qt/ActionMapper.cpp @@ -87,7 +87,13 @@ void ActionMapper::rebuildMenu(const QString& menu, QMenu* qmenu, QWidget* conte } }); QObject::connect(action, &Action::enabled, qaction, &QAction::setEnabled); - QObject::connect(action, &Action::activated, qaction, &QAction::setChecked); + QObject::connect(action, &Action::activated, [qaction, action](bool active) { + if (qaction->isCheckable()) { + qaction->setChecked(active); + } else if (active) { + action->setActive(false); + } + }); QObject::connect(action, &Action::destroyed, qaction, &QAction::deleteLater); if (shortcut) { QObject::connect(shortcut, &Shortcut::shortcutChanged, qaction, [qaction](int shortcut) {