Commit 4403e86a authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Don't try to filter null key combinations

When using composite key combinations, kwin would do random weird
actions when the first key was pressed (e.g. ` key). This makes sure we
are not trying to match.

BUG: 390110

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: graesslin, kwin, #kwin

Tags: #kwin

Differential Revision:
parent b2ed73cd
......@@ -55,6 +55,7 @@ private Q_SLOTS:
void testRepeatedTrigger();
void testUserActionsMenu();
void testMetaShiftW();
void testComponseKey();
void testX11ClientShortcut();
void testWaylandClientShortcut();
void testSetupWindowShortcut();
......@@ -203,6 +204,25 @@ void GlobalShortcutsTest::testMetaShiftW()
kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTMETA, timestamp++);
void GlobalShortcutsTest::testComponseKey()
// BUG 390110
QScopedPointer<QAction> action(new QAction(nullptr));
action->setProperty("componentName", QStringLiteral(KWIN_NAME));
QSignalSpy triggeredSpy(, &QAction::triggered);
KGlobalAccel::self()->setShortcut(, QList<QKeySequence>{Qt::UNICODE_ACCEL}, KGlobalAccel::NoAutoloading);
// 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)
......@@ -245,6 +245,9 @@ bool processShortcut(Qt::KeyboardModifiers mods, T key, U &shortcuts)
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;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment