Author :
Pierre Le Marre
Date :
2024-08-20 16:41:38
Hash :05ba96db Message :rules: Fix wild card handling
The handling of wild card `*` is different in libxkbfile and X server:
wild card matches empty strings for model and option but not for layout
nor variant, while in libxkbcommon wild cards always match empty strings.
See:
- https://gitlab.freedesktop.org/xorg/lib/libxkbfile/-/blob/bf985c68acb1244f51ec91414532a2347fbc1c4c/src/maprules.c#L687
- https://gitlab.freedesktop.org/xorg/lib/libxkbfile/-/blob/bf985c68acb1244f51ec91414532a2347fbc1c4c/src/maprules.c#L712
The difference of handling between the components is unfortunately not
documented, but we should follow the behavior of the original
implementations for consistency.
- Fixed by implementing the same behavior than libxkbfile.
- Added tests and fixed failing tests.
- Improve the documentation of rules to highlight the special behavior.
changes/api/497.bugfix.md
rules: Fix handling of wild card `*` to match the behavior of `libxkbfile`.
Previously `*` would match any value, even empty one. Now:
- For `model` and `options`: *always* match.
- For `layout` and `variant`: match any *non-empty* value.