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 de940e06f8

Fixes #1249

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit be16bd8543)
This commit is contained in:
Peter Hutterer 2021-12-02 10:41:03 +10:00 committed by Povilas Kanapickas
parent 49444ce9f7
commit 2c6989f81e

View File

@ -2511,15 +2511,14 @@ _XkbSetMapChecks(ClientPtr client, DeviceIntPtr dev, xkbSetMapReq * req,
} }
} }
if ((req->present & XkbKeyTypesMask) && if (!(req->present & XkbKeyTypesMask)) {
(!CheckKeyTypes(client, xkb, req, (xkbKeyTypeWireDesc **) &values, nTypes = xkb->map->num_types;
&nTypes, mapWidths, doswap))) { }
else if (!CheckKeyTypes(client, xkb, req, (xkbKeyTypeWireDesc **) &values,
&nTypes, mapWidths, doswap)) {
client->errorValue = nTypes; client->errorValue = nTypes;
return BadValue; return BadValue;
} }
else {
nTypes = xkb->map->num_types;
}
/* symsPerKey/mapWidths must be filled regardless of client-side flags */ /* symsPerKey/mapWidths must be filled regardless of client-side flags */
map = &xkb->map->key_sym_map[xkb->min_key_code]; map = &xkb->map->key_sym_map[xkb->min_key_code];