lokid and hikid actually stores the sibling to current node, which
should not be cleared when override. This would break the sequence with
a common prefix when override another.
Fix#286
Signed-off-by: Weng Xuetian <wengxt@gmail.com>
From the documentation:
> It does not clean up parser state, it cleans up memory allocated by the library
> itself. It is a cleanup function for the XML library. It tries to reclaim all
> related global memory allocated for the library processing. [...]
> One should call xmlCleanupParser() only when the process has finished using the library.
http://xmlsoft.org/html/libxml-parser.html#xmlCleanupParser
Since we're a library ourselves we cannot know if something else in the same
proces uses the parser, so we must not call this.
Reported-by: M Hickford
This makes it easier for contributors to check if their code runs correctly
without having to file a PR.
The Mac and Windows workflows are a bit more involved, so let's keep those on
pull requests only.
"main" is a bit non-descriptive, let's name them after the platforms we run them
on. Splitting them up allows us to be less selective on how we run the various
workflows, e.g. always running the linux one.
Because otherwise the 'no' layout is treated as disagreement with whatever is to
be disagreed with. Fixed in YAML 1.2 but that's not universally supported.
Fixes#268
In 1b3a1c277a we changed the error
handling in this code to not bail out immediately but only after
everything has been processed, to simplify the code. But I suspect the
code isn't prepared for this and that's what causing the crash reported
in the issue.
Bring back the short-circuit error handling which would hopefully fix
such crashes.
Fixes: https://github.com/xkbcommon/libxkbcommon/issues/252
Signed-off-by: Ran Benita <ran@unusedvar.com>
Previously, could only check how to type a Unicode codepoint, but
searching for a keysym directly is also occasionally useful.
Signed-off-by: Ran Benita <ran@unusedvar.com>
Don't assume that keycode 9 means Escape. Instead, use the keymap
to check for Esc.
Logic copied from the Wayland version.
Signed-off-by: Simon Ser <contact@emersion.fr>
While the previous 1987-style[0] scheme was fun (and I reasonably
optimized it for a fair comparison), this task is more suited to a hash
table. Even a simple implementation beats the old one.
[0] Seems to have first appeared in X11R1, released September 1987.
See server/dix/atom.c here: https://www.x.org/releases/X11R1/X.V11R1.tar.gz
Signed-off-by: Ran Benita <ran@unusedvar.com>
Specify where to find the headers for libxkbcommon_dep,
libxkbcommon_x11_dep, and libxkbregistry_dep, which allows other
projects to correctly locate the headers when libxkbcommon is being
built as a Meson subproject.
The dep_libxkbregistry variable is renamed to libxkbregistry_dep,
to follow the usual convention for variables which hold declared
dependencies to be used from subproject builds.
Arrange for passing .def files with the lists of symbols to export from
DLLs when building on Windows with MSVC. Without this no symbols were
being exported at all.
The .def files are generated from the .map files at build time using
scripts/map-to-def, which avoids needing to maintain two different sets
of files.
We have a lot of keyboard layouts and the current output format is virtually
useless at searching for a specific one to debug any issues with either the
layout list or the output from libxkbregistry.
Let's use YAML instead because that can easily be post-processed to extract the
specific layouts wanted, e.g. to get the list of all layouts:
xkbcli-list | yq -r ".layouts[].layout"
to get the list of all variants of the "us" layout:
xkbcli-list | yq -r '.layouts[] | select(.layout == "us") | .variant
and the number of option groups:
xkbcli-list | yq -r '.option_groups[] | length'
Note that the top-level nodes have been de-capitalized, so where it was "Models"
before it is now "models" and the "Options" node is now "option_groups".
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This is hit when passing an empty string and XKB_KEYSYM_CASE_INSENSITIVE
to xkb_keysym_from_name currently if `(lo + hi) / 2` is 0 and `cmp < 0`,
causing mid to underflow and the the array access into name_to_keysym on
the next iteration of the loop to be out of bounds .
We *would* use ssize_t here as it is the appropriate type, but windows
unfortunately does not define it.