Timo Aaltonen pushed to branch upstream-unstable at X Strike Force / lib /
libxkbcommon
Commits:
01bdcc82 by Pierre Le Marre at 2025-10-29T16:32:02+01:00
context: Improve error message for failed default include paths
- - - - -
924b3cb0 by Pierre Le Marre at 2025-10-29T16:32:02+01:00
context: Add default include paths only if necessary
Default includes paths are delayed and added only if necessary.
It is more efficient for most clients, which only get the keymap from
the server: it avoids unnecessary allocations and file system queries.
It also avoid the corner case where a containerized app lack access to
the XKB directories.
There might be an issue in case the environment variables relevant to
the include paths change between the context initialization and the
call to `xkb_context_include_path_append_default()`. However this seems
very unlikely and would have already triggered issues when the `%`-
expansion is used.
- - - - -
52fe6980 by Pierre Le Marre at 2025-10-31T15:11:11+01:00
how-to-type: Fixed Compose lookup with non-canonical keysym
This fixes the lookup of the following entry from the standard `en_US`
Compose file:
<Multi_key> <minus> <minus> <minus> : "—" U2014 # EM DASH
Before this commit the sequence was found with `U2014` but not with
“—” nor `emdash`.
Fixed by looking at the entry’s UTF-8 string as well.
- - - - -
244f3a81 by Pierre Le Marre at 2025-11-03T06:51:27+01:00
keysyms: Update using latest xorgproto
xorgproto commit: f973f7db89571f61e96cb0a55f416d3e67a75663
Relevant MR:
https://gitlab.freedesktop.org/xorg/proto/xorgproto/-/merge_requests/102
- - - - -
46c4357c by Pierre Le Marre at 2025-11-04T05:27:55+01:00
doc: Improve FAQ
- - - - -
3f65403f by Pierre Le Marre at 2025-11-04T05:27:55+01:00
doc: Add migration instructions for multiple groups per key
- - - - -
e9573310 by Pierre Le Marre at 2025-11-04T09:40:01+01:00
rules: Add new lookup mechanism: pre & post
Before this commit, the only way to extend rules was to override the
default rules files by creating a file with the same name in an include
directory with a higher priority than the default rules file. However,
this prevented to *compose* any rules extension by other mean than
explicit includes/inlining all rules in the higher priority rules files.
This commit introduces a new lookup mechanism that enables to extend
rules without altering the main rules file and facilitate *rules
composition*. The main motivation is to support composing custom rules
with the upcoming XKB *extensions mechanism*. This is done by enabling
*partial* rules files `<rules>.pre` and `<rules>.post`.
The previous lookup mechanism:
1. Find the rules file `<rules>`
2. Fail if not found
3. Otherwise resolves the rules
4. Fail if any required component is missing
5. Otherwise return the resolved KcCGST names
is replaced with:
1. Find the main rules file `<rules>`
2. Fail if not found
3. For each include directory:
1. Try to find the *partial* rules file `<rules>.pre` in the directory
2. If none is found, continue to the next directory
3. Otherwise resolve the rules from `<rules>.pre` by appending the
resolved components to the previous result
This may combine *multiple* `<rules>.pre` files.
4. resolve the rules from `<rules>` by appending to the previous result;
5. same as step 3, but with the rules file `<rules>.post`.
Thus the final rule set is equivalent to:
! include <include path 1>/rules/<rules>.pre // only if defined
…
! include <include path n>/rules/<rules>.pre // only if defined
! include <rules> // main rules file
! include <include path 1>/rules/<rules>.post // only if defined
…
! include <include path n>/rules/<rules>.post // only if defined
Example: given the following tree:
- `~/.config/xkb/rules`
- `evdev.post`
- `/etc/xkb/rules`
- `evdev.pre`
- `evdev.post`
- `/usr/share/xkeyboard-config-2/rules`
- `evdev`
the new mechanism is equivalent to parsing the following rules file:
// .pre rules
include %E/evdev.pre // only .pre file
// main rules
include %S/evdev
// .post rules
include %H/.config/xkb/evdev.post // higher priority than /etc/xkb
include %E/evdev.post
- - - - -
081f7571 by Pierre Le Marre at 2025-11-04T11:08:33+01:00
context: Add support for XKB extensions directories
libxkbcommon introduced flexibility by enabling multiple XKB lookup
paths. However, there is no easy way to distribute packages that provide
XKB data: such packages usually resort to modify the root XKB directory,
which is very fragile.
This can be solved by adopting the `.d` directory approach used in e.g.
`/etc`.
Added another XKB path lookup mechanism: the XKB extensions directories.
There are 2 root extensions directories, both optional:
- `XKB_CONFIG_UNVERSIONED_EXTENSIONS_PATH`, defaulting to
`<xkeyboard-config-root>` - version suffix + `.d`, e.g.
`/usr/share/xkeyboard-config.d`. It is intended as the default
extensions path.
- `XKB_CONFIG_VERSIONED_EXTENSIONS_PATH`, defaulting to
`<xkeyboard-config-root>` + `.d`, e.g. `/usr/share/xkeyboard-config-2.d`.
It is intended for backward compatibility.
`XKB_CONFIG_VERSIONED_EXTENSIONS_PATH` has higher priority than
`XKB_CONFIG_UNVERSIONED_EXTENSIONS_PATH`.
When appending the default include paths, after the extra path but before
the canonical XKB root, for each directory above: its subdirectories are
appended in lexicographic order to the include paths; unversioned
subdirectories are appended only if there is no corresponding versioned
subdirectory.
Example: given the following setup:
- `XKEYBOARD_CONFIG_ROOT` = `/usr/share/xkeyboard-config-2`
- `/usr/share/xkeyboard-config-2.d` tree:
- `p1` (installed by package p1)
- `rules/evdev.xml`
- `symbols/a`
- `p2` (installed by package p2)
- `rules/evdev.xml`
- `symbols/b`
- `/usr/share/xkeyboard-config.d` tree:
- `p1` (installed by package p1)
- `rules/evdev.xml`
- `symbols/a`
- `p3` (installed by package p3)
- `rules/evdev.xml`
- `symbols/c`
then the include path list may be:
1. `~/.config/xkb`
2. `~/.xkb`
3. `/etc/xkb`
4. `/usr/share/xkeyboard-config-2.d/p1`
5. `/usr/share/xkeyboard-config-2.d/p2`
6. `/usr/share/xkeyboard-config.d/p3`
7. `/usr/share/xkeyboard-config`
In this example:
- Package p1 distributes a layout with specific compatibility files for
xkeyboard-config v2 and fallback files for v3+. In this case the
versioned files have priority, so the unversioned
`/usr/share/xkeyboard-config.d/p1` path is not included.
- Package p2 distributes only a layout specific to xkeyboard-config v2.
- Package p3 distribute a layout for any xkeyboard-config version.
- - - - -
c8fcf8b7 by Pierre Le Marre at 2025-11-04T11:08:33+01:00
registry: Add support for XKB extensions directories
- - - - -
a6c55838 by Pierre Le Marre at 2025-11-04T11:08:33+01:00
build: Expose default XKB directories through pkg-config
- - - - -
cb8ecea7 by Pierre Le Marre at 2025-11-05T09:13:28+01:00
rules: Do not print error for missing .pre and .post rules files
These files are optional!
- - - - -
02d96466 by Pierre Le Marre at 2025-11-05T09:13:28+01:00
test: Fix for setups with XKB extension directories
- - - - -
3049d310 by Pierre Le Marre at 2025-11-05T10:40:57+01:00
Bump version to 1.13.0
- - - - -
3515a030 by Pierre Le Marre at 2025-12-02T10:34:08+01:00
ci: Enable on releases/** branches
- - - - -
3e1a3891 by Pierre Le Marre at 2025-12-03T15:49:40+01:00
xkbcomp: Fix segfault when copying aliases to keymap
- - - - -
6f76d19d by Pierre Le Marre at 2025-12-03T16:35:13+01:00
Bump version to 1.13.1
- - - - -
63 changed files:
- .github/workflows/linux.yml
- .github/workflows/macos.yml
- .github/workflows/windows.yml
- NEWS.md
- doc/compatibility.md
- doc/faq.md
- doc/message-registry.md
- doc/message-registry.yaml
- + doc/packaging-keyboard-layouts.md
- doc/rules-format.md
- doc/user-configuration.md
- include/xkbcommon/xkbcommon-keysyms.h
- include/xkbcommon/xkbcommon.h
- meson.build
- meson_options.txt
- src/context-priv.c
- src/context.c
- src/context.h
- src/darray.h
- src/keysym.h
- src/ks_tables.h
- src/messages-codes.h
- src/registry.c
- src/xkbcomp/include.c
- src/xkbcomp/include.h
- src/xkbcomp/keymap-file-iterator.c
- src/xkbcomp/keymap.c
- src/xkbcomp/rules.c
- test/buffercomp.c
- test/common.c
- test/context.c
- + test/data/extensions/with-rules-2/p1/rules/evdev.post
- + test/data/extensions/with-rules-2/p1/rules/evdev.xml
- + test/data/extensions/with-rules-2/p1/symbols/11
- + test/data/extensions/with-rules-2/p2/rules/evdev.extras.xml
- + test/data/extensions/with-rules-2/p2/rules/evdev.post
- + test/data/extensions/with-rules-2/p2/symbols/2
- + test/data/extensions/with-rules/p1/rules/evdev.post
- + test/data/extensions/with-rules/p1/rules/evdev.xml
- + test/data/extensions/with-rules/p1/symbols/1
- + test/data/extensions/with-rules/p3/rules/evdev.post
- + test/data/extensions/with-rules/p3/rules/evdev.xml
- + test/data/extensions/with-rules/p3/symbols/3
- + test/data/extensions/without-rules-2/p1/rules/evdev.xml
- + test/data/extensions/without-rules-2/p1/symbols/a
- + test/data/extensions/without-rules-2/p2/rules/evdev.extras.xml
- + test/data/extensions/without-rules-2/p2/symbols/b
- + test/data/extensions/without-rules/p1/rules/evdev.xml
- + test/data/extensions/without-rules/p1/symbols/a
- + test/data/extensions/without-rules/p3/rules/evdev.xml
- + test/data/extensions/without-rules/p3/symbols/c
- + test/data/extra/rules/partial.post
- + test/data/extra/rules/partial.pre
- + test/data/keymaps/keycodes-aliases-3.xkb
- + test/data/rules/partial
- + test/data/rules/partial.post
- + test/data/rules/partial.pre
- + test/extensions-directories.c
- test/keymap.c
- test/rules-file.c
- test/tool-option-parsing.py
- tools/how-to-type.c
- tools/messages.c
The diff was not included because it is too large.
View it on GitLab:
https://salsa.debian.org/xorg-team/lib/libxkbcommon/-/compare/f4f732790c35632427f857395f37c93e19729a2b...6f76d19db72b5d450e927b41e1e96cbe3252aba8
--
View it on GitLab:
https://salsa.debian.org/xorg-team/lib/libxkbcommon/-/compare/f4f732790c35632427f857395f37c93e19729a2b...6f76d19db72b5d450e927b41e1e96cbe3252aba8
You're receiving this email because of your account on salsa.debian.org.