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>
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)