Files
xserver/xkb
Wismill dc79426c04 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 (squashed with this one).

------------------------------------------------------------------

xkb: Fix serialization of key type without level names

Before this commit the count of key type level names was wrongly set
in `XkbGetNames`: for key type without names, it was set to the level
count, while it should be 0:
- `XkbComputeGetNamesReplySize()` does not account key type without
  level names;
- `XkbSendNames()` does not write any level entry for key types without
  level names.

This causes a mismatch offset while parsing the response and its
processing would ultimately fail.

Fixed by setting the correct level name count: 0 if there is no level
name, else the number of levels.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2082>
2026-03-16 13:23:16 +01:00
..
2025-06-12 17:21:45 +02:00
2025-06-12 17:21:45 +02:00
2025-06-12 17:21:45 +02:00
2025-06-12 17:21:45 +02:00
2025-06-12 17:21:45 +02:00
2026-02-05 15:25:48 +01:00
2003-11-14 15:54:54 +00:00
2026-03-16 13:11:07 +01:00
2026-03-16 13:11:07 +01:00
2026-03-16 13:11:07 +01:00
2026-03-16 13:11:07 +01:00

The X server uses this directory to store the compiled version of the
current keymap and/or any scratch keymaps used by clients.  The X server
or some other tool might destroy or replace the files in this directory,
so it is not a safe place to store compiled keymaps for long periods of
time.  The default keymap for any server is usually stored in:
     X<num>-default.xkm
where <num> is the display number of the server in question, which makes
it possible for several servers *on the same host* to share the same 
directory.

Unless the X server is modified, sharing this directory between servers on
different hosts could cause problems.