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>
master
Ran Benita 2014-10-17 00:41:05 +03:00
parent a4c667adf2
commit 30e7445d84
1 changed files with 1 additions and 1 deletions

View File

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