diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2021-12-02 10:41:03 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2021-12-03 00:33:23 +0000 |
commit | be16bd8543f80ad2933ec9c37f082617c7084165 (patch) | |
tree | 97283b9b61218adaaab80e5162a095d3e4393a81 /xkb | |
parent | 6dd9709bd85cf5de4067887818c864220b951355 (diff) |
xkb: fix XkbSetMap check for the keytypes count
The previous if/else condition resulted in us always setting the key
type count to the current number of key types. Split this up correctly.
Regression introduced in de940e06f8733d87bbb857aef85d830053442cfe
Fixes #1249
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'xkb')
-rw-r--r-- | xkb/xkb.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -2511,15 +2511,14 @@ _XkbSetMapChecks(ClientPtr client, DeviceIntPtr dev, xkbSetMapReq * req, } } - if ((req->present & XkbKeyTypesMask) && - (!CheckKeyTypes(client, xkb, req, (xkbKeyTypeWireDesc **) &values, - &nTypes, mapWidths, doswap))) { - client->errorValue = nTypes; - return BadValue; - } - else { + if (!(req->present & XkbKeyTypesMask)) { nTypes = xkb->map->num_types; } + else if (!CheckKeyTypes(client, xkb, req, (xkbKeyTypeWireDesc **) &values, + &nTypes, mapWidths, doswap)) { + client->errorValue = nTypes; + return BadValue; + } /* symsPerKey/mapWidths must be filled regardless of client-side flags */ map = &xkb->map->key_sym_map[xkb->min_key_code]; |