xcb: Don't return 0 from QXcbKeyboard::possibleKeys

It's possible to get 0 for baseQtKey in case Caps Lock is used as
a layout switcher. So don't include this value in the result.
Similar fix was in commit d904533acb.

Task-number: QTCREATORBUG-9589
Change-Id: I46fc91f9faf6fd0699f062a72fd2ca3187232f5a
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
This commit is contained in:
Alexander Volkov 2014-12-12 14:37:36 +03:00
parent 9290383a1e
commit 8a075c4057

View File

@ -957,7 +957,8 @@ QList<int> QXcbKeyboard::possibleKeys(const QKeyEvent *event) const
QList<int> result;
int baseQtKey = keysymToQtKey(sym, modifiers, lookupString(kb_state, keycode));
result += (baseQtKey + modifiers); // The base key is _always_ valid, of course
if (baseQtKey)
result += (baseQtKey + modifiers);
xkb_mod_index_t shiftMod = xkb_keymap_mod_get_index(xkb_keymap, "Shift");
xkb_mod_index_t altMod = xkb_keymap_mod_get_index(xkb_keymap, "Alt");