summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRan Benita <ran234@gmail.com>2014-10-17 00:41:05 +0300
committerRan Benita <ran234@gmail.com>2014-10-17 01:17:59 +0300
commit30e7445d846e45f68dd21fd6d954eb7806adc8bd (patch)
tree58a8a307a55213863e685ffe4e79d8d58a343a04
parenta4c667adf285d8cfcfdea29cbf845abd4b180467 (diff)
downloadxorg-lib-libxkbcommon-30e7445d846e45f68dd21fd6d954eb7806adc8bd.tar.gz
state: correctly infer inactive type entries
The current test is incorrect, since 'map[None]' is entirely valid. In most cases this doesn't cause any problems, since the default fallback is Level1, and it's almost always 'map[None] = Level1' anyway. But in one case in xkeyboard-config it isn't, in types/numpad(mac): type "KEYPAD" { modifiers = None; map[None] = Level2; level_name[Level2] = "Number"; }; So before checking if no modifiers were mapped, make sure there *were* any modifiers at all. https://bugs.freedesktop.org/show_bug.cgi?id=85092 Reported-by: Gatis Paeglis <gatis.paeglis@digia.com> Signed-off-by: Ran Benita <ran234@gmail.com>
-rw-r--r--src/state.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/state.c b/src/state.c
index 6613969..642ed08 100644
--- a/src/state.c
+++ b/src/state.c
@@ -129,7 +129,7 @@ get_entry_for_key_state(struct xkb_state *state, const struct xkb_key *key,
* supposed to skip the entry (xserver does this with cached
* entry->active field).
*/
- if (!type->entries[i].mods.mask)
+ if (type->entries[i].mods.mods != 0 && type->entries[i].mods.mask == 0)
continue;
if (type->entries[i].mods.mask == active_mods)