From d904533acba1267431ca2c5f0d3e85cc59a20a26 Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Mon, 6 Oct 2014 19:22:00 +0400 Subject: [PATCH] xcb: Don't return 0 as a possible key for a shortcut QXcbKeyboard::keysymToQtKey() may return a value of 0 for keysyms that are not supported by Qt (e.g. for XK_ISO_Next_Group). It is then translated to an empty QKeySequence which in turn is detected as a partial match for any shortcut. The behavior of QShortcutMap::nextState() becomes broken because it sets current state to QKeySequence::PartialMatch while there is no match at all. Task-number: QTCREATORBUG-9589 Change-Id: I1e2a4511a876dfa418db9906d10382255a2e4d62 Reviewed-by: Gatis Paeglis Reviewed-by: Sergey Belyashov --- src/plugins/platforms/xcb/qxcbkeyboard.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.cpp b/src/plugins/platforms/xcb/qxcbkeyboard.cpp index 7e70e7258d..8c12b29a99 100644 --- a/src/plugins/platforms/xcb/qxcbkeyboard.cpp +++ b/src/plugins/platforms/xcb/qxcbkeyboard.cpp @@ -903,7 +903,7 @@ QList QXcbKeyboard::possibleKeys(const QKeyEvent *event) const Qt::KeyboardModifiers mods = modifiers & ~neededMods; qtKey = keysymToQtKey(sym, mods, lookupString(kb_state, event->nativeScanCode())); - if (qtKey == baseQtKey) + if (qtKey == baseQtKey || qtKey == 0) continue; result += (qtKey + mods);