diff --git a/autotests/integration/globalshortcuts_test.cpp b/autotests/integration/globalshortcuts_test.cpp --- a/autotests/integration/globalshortcuts_test.cpp +++ b/autotests/integration/globalshortcuts_test.cpp @@ -55,6 +55,7 @@ void testRepeatedTrigger(); void testUserActionsMenu(); void testMetaShiftW(); + void testComponseKey(); void testX11ClientShortcut(); void testWaylandClientShortcut(); void testSetupWindowShortcut(); @@ -203,6 +204,25 @@ kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTMETA, timestamp++); } +void GlobalShortcutsTest::testComponseKey() +{ + // BUG 390110 + QScopedPointer action(new QAction(nullptr)); + action->setProperty("componentName", QStringLiteral(KWIN_NAME)); + action->setObjectName(QStringLiteral("globalshortcuts-accent")); + QSignalSpy triggeredSpy(action.data(), &QAction::triggered); + QVERIFY(triggeredSpy.isValid()); + KGlobalAccel::self()->setShortcut(action.data(), QList{Qt::UNICODE_ACCEL}, KGlobalAccel::NoAutoloading); + input()->registerShortcut(Qt::UNICODE_ACCEL, action.data()); + + // press & release ` + quint32 timestamp = 0; + kwinApp()->platform()->keyboardKeyPressed(KEY_RESERVED, timestamp++); + kwinApp()->platform()->keyboardKeyReleased(KEY_RESERVED, timestamp++); + + QTRY_COMPARE(triggeredSpy.count(), 0); +} + struct XcbConnectionDeleter { static inline void cleanup(xcb_connection_t *pointer) diff --git a/globalshortcuts.cpp b/globalshortcuts.cpp --- a/globalshortcuts.cpp +++ b/globalshortcuts.cpp @@ -245,6 +245,9 @@ bool GlobalShortcutsManager::processKey(Qt::KeyboardModifiers mods, int keyQt) { if (m_kglobalAccelInterface) { + if (!keyQt && !mods) { + return false; + } auto check = [this] (Qt::KeyboardModifiers mods, int keyQt) { bool retVal = false; QMetaObject::invokeMethod(m_kglobalAccelInterface,