From fc0a31c5e8cda3930cdf0fb7a37ab5afc2ab4c2f Mon Sep 17 00:00:00 2001 From: ronso0 Date: Sat, 13 Sep 2025 02:20:48 +0200 Subject: [PATCH] fix menubar hotkey (Alt) for Qt 6.9 --- src/controllers/keyboard/keyboardeventfilter.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/controllers/keyboard/keyboardeventfilter.cpp b/src/controllers/keyboard/keyboardeventfilter.cpp index b5203885959a..215a7fabd4ee 100644 --- a/src/controllers/keyboard/keyboardeventfilter.cpp +++ b/src/controllers/keyboard/keyboardeventfilter.cpp @@ -77,11 +77,10 @@ bool KeyboardEventFilter::eventFilter(QObject*, QEvent* e) { #ifndef __APPLE__ } else { // getKeySeq() returns empty string if the press was a modifier only - if ((ke->modifiers() & Qt::AltModifier) && !m_altPressedWithoutKey) { - // on Linux pressing Alt sends Alt+Qt::Key_Alt, so checking for - // Alt modifier is sufficient. - // Activate this in case there are issues on Windows - // || ke->key() == Qt::Key_Alt) { + // On most system Alt sends Alt + Qt::Key_Alt, but with Qt 6.9 (on Linux) + // this changed apparently so that it's just Qt::Key_Alt + if (((ke->modifiers() & Qt::AltModifier) || ke->key() == Qt::Key_Alt) && + !m_altPressedWithoutKey) { m_altPressedWithoutKey = true; } #endif