mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-03-29 10:10:39 +02:00
xkb: Fix key type without level names in XkbCopyKeymap
A key type that has no level names is legit. Before this commit,
`XkbCopyKeymap` would make such level inconsistent by setting its
number of levels to 0 while keeping its map entries. It suffices
to clear the names array.
Fixed by copying the level count from the source type.
WARNING: this will trigger an error in `XkbGetNames`, which worked
before this commit only by chance. This is fixed in the next commit.
(cherry picked from commit 12605989af)
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2146>
This commit is contained in:
parent
d2f1d74f6c
commit
bdc7eb8f07
1 changed files with 1 additions and 1 deletions
|
|
@ -1047,7 +1047,7 @@ _XkbCopyClientMap(XkbDescPtr src, XkbDescPtr dst)
|
|||
if (dtype->num_levels && dtype->level_names &&
|
||||
i < dst->map->num_types)
|
||||
free(dtype->level_names);
|
||||
dtype->num_levels = 0;
|
||||
dtype->num_levels = stype->num_levels;
|
||||
dtype->level_names = NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue