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 <gatis.paeglis@digia.com>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
This commit is contained in:
Alexander Volkov 2014-10-06 19:22:00 +04:00
parent 6d1c4c8862
commit d904533acb

View File

@ -903,7 +903,7 @@ QList<int> 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);