summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Variants should inherit iso639, iso3166 and brief from parent layout if ↵M Hickford2022-01-242-3/+34
| | | | omitted (#266)
* registry: skip over invalid ISO639 or ISO3166 entriesPeter Hutterer2022-01-242-7/+157
| | | | If the XML file is somehow off, don't load entries that are against the spec.
* test: show the tool exit status on failurePeter Hutterer2022-01-241-1/+1
| | | | | We already do so for the non-successful cases, let's do this here too so we know whether it was a signal or a normal exit.
* registry: don't call xmlCleanupParser()Peter Hutterer2022-01-181-1/+0
| | | | | | | | | | | | | | | 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
* CI: always run the linux workflowPeter Hutterer2022-01-171-5/+1
| | | | | | | | 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.
* CI: split and rename the workflows to windows/macos/linuxPeter Hutterer2022-01-174-108/+130
| | | | | | "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.
* Update README.mdM Hickford2022-01-112-3/+1
| | | | Co-authored-by: Ran Benita <ran@unusedvar.com>
* Add instructions to run tests. Add build/ to .gitignore.matthickford2022-01-112-0/+3
|
* build: add enable-tools optionAlex Xu (Hello71)2021-12-052-4/+8
| | | | | | this is mainly useful for multilib, but may be useful for other users as well Signed-off-by: Alex Xu (Hello71) <alex_y_xu@yahoo.ca>
* tools/list: print an empty string for null vendor stringsPeter Hutterer2021-11-111-1/+2
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools/list: enclose the the various field names in quotesPeter Hutterer2021-11-111-7/+7
| | | | | | | 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
* man: mention `xkbcli list` output is meant to be in YAML 1.2 formatRan Benita2021-11-011-4/+4
| | | | Signed-off-by: Ran Benita <ran@unusedvar.com>
* ci: possible fix for release workflowRan Benita2021-09-171-1/+1
| | | | Signed-off-by: Ran Benita <ran@unusedvar.com>
* Bump version to 1.3.1xkbcommon-1.3.1Ran Benita2021-09-102-1/+17
| | | | Signed-off-by: Ran Benita <ran@unusedvar.com>
* x11: try to fix crash in xkb_x11_keymap_new_from_device error handlingRan Benita2021-09-091-12/+30
| | | | | | | | | | | | | | In 1b3a1c277a033083fee669e92c8cad862716ebd1 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>
* x11: stylistic fixesRan Benita2021-08-312-8/+9
| | | | Signed-off-by: Ran Benita <ran@unusedvar.com>
* tools/how-to-type: add --keysym for how to type a keysymRan Benita2021-07-312-14/+32
| | | | | | | 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>
* tools/interactive-x11: use keysym to look for EscSimon Ser2021-07-121-1/+1
| | | | | | | | | 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>
* bench/compose: fix compose file pathRan Benita2021-06-101-1/+1
| | | | | | Forgotten in e2465c2. Signed-off-by: Ran Benita <ran@unusedvar.com>
* ci: some tweaksRan Benita2021-05-222-12/+35
| | | | | | | - Reduce permissions - Update some stuff Signed-off-by: Ran Benita <ran@unusedvar.com>
* ci: also link to tarball in github releaseRan Benita2021-05-221-1/+3
| | | | Signed-off-by: Ran Benita <ran@unusedvar.com>
* ci: automatically create github release when tag is pushedRan Benita2021-05-221-0/+21
| | | | | Fixes: https://github.com/xkbcommon/libxkbcommon/issues/233 Signed-off-by: Ran Benita <ran@unusedvar.com>
* test/tool-option-parsing: don't depend on build prefixRan Benita2021-05-221-0/+4
| | | | | Fixes: https://github.com/xkbcommon/libxkbcommon/issues/244 Signed-off-by: Ran Benita <ran@unusedvar.com>
* test/compose: add tests for xkb_compose_table_new_from_locale lookupRan Benita2021-05-221-0/+44
| | | | Signed-off-by: Ran Benita <ran@unusedvar.com>
* test/compose: clean up after a setenvRan Benita2021-05-221-0/+2
| | | | Signed-off-by: Ran Benita <ran@unusedvar.com>
* tests/data: add files needed to fully test composeRan Benita2021-05-226-4/+4389
| | | | Signed-off-by: Ran Benita <ran@unusedvar.com>
* ignore: remove no longer relevant gitignore filesRan Benita2021-05-225-33/+0
| | | | | | These were relevant for the autoconf build but now we're meson only. Signed-off-by: Ran Benita <ran@unusedvar.com>
* xkbcommon: deprecate XK_approxeq and XK_notapproxeqRan Benita2021-05-221-2/+2
| | | | | | | | Sync xorg-proto commit https://gitlab.freedesktop.org/xorg/proto/xorgproto/-/commit/25f3278b85ec7d1c78bb150eaea52f9c98294ea4 Fixes: #82 Signed-off-by: Ran Benita <ran@unusedvar.com>
* scripts/update-keysyms: fix path to the include files after de1b6943dPeter Hutterer2021-05-141-2/+2
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: add compose tool for Compose debuggingRan Benita2021-05-082-0/+131
| | | | | | Not very useful so not exposed in xkbcli. Signed-off-by: Ran Benita <ran@unusedvar.com>
* compose: add mapped locale to Compose-file-not-found error logRan Benita2021-05-081-1/+2
| | | | Signed-off-by: Ran Benita <ran@unusedvar.com>
* Bump version to 1.3.0xkbcommon-1.3.0Ran Benita2021-05-012-1/+33
| | | | Signed-off-by: Ran Benita <ran@unusedvar.com>
* atom: rewrite as a hash tableRan Benita2021-04-271-68/+64
| | | | | | | | | | | 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>
* bench: add atom benchmarkRan Benita2021-04-272-0/+98
| | | | Signed-off-by: Ran Benita <ran@unusedvar.com>
* bench/rulescomp: decrease benchmark iterationsRan Benita2021-04-271-1/+1
| | | | | | No need for more, and easier to convert to milliseconds per iteration. Signed-off-by: Ran Benita <ran@unusedvar.com>
* build: fix missing includesRan Benita2021-04-271-8/+8
| | | | Signed-off-by: Ran Benita <ran@unusedvar.com>
* Move include files to include/ subdirectoryRan Benita2021-04-278-20/+20
| | | | | | | This way we don't specify `include_directorories('.')` which brings in more than needed. Signed-off-by: Ran Benita <ran@unusedvar.com>
* build: move the subproject variables to a common section at the endRan Benita2021-04-271-9/+17
| | | | | | | As suggested in: https://github.com/xkbcommon/libxkbcommon/pull/240#discussion_r620784021 Signed-off-by: Ran Benita <ran@unusedvar.com>
* Meson: Allow building as subprojectAdrian Perez de Castro2021-04-271-4/+10
| | | | | | | | | | | 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.
* Windows: Pass list of symbols to export to MSVCAdrian Perez de Castro2021-04-272-3/+64
| | | | | | | | | | 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.
* tools: change xkbcli list to output YAMLPeter Hutterer2021-04-271-18/+26
| | | | | | | | | | | | | | | | | | | 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>
* tools: change the list separator handlingPeter Hutterer2021-04-271-13/+14
| | | | | | Slightly easier to read than the "bool first" approach. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* keysym: fix underflow in binary searchesIsaac Freund2021-04-252-4/+7
| | | | | | | | | | 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.
* test: allow skipping errors in certain conditionsPeter Hutterer2021-04-221-2/+11
| | | | | | | | | | Add a skipError test function that can analyse rc, stdout, stderr to skip a test even when we expect an error. We use that to skip if we couldn't find a keyboard in the interactive-evdev test. Fixes #235 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* test: add extra info to the layout-tester --help outputPeter Hutterer2021-04-201-1/+6
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* test: print the layout-tester progress bar to stdout by defaultPeter Hutterer2021-04-201-2/+2
| | | | | | | | tqdm prints to stderr by default but we're using that for failed keymap compiles (which are the ones that really matter). Plus, whether we're using tqdm is dependent on isatty(sys.stdout) anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* test: add an LVO argument to the XKB layout testerPeter Hutterer2021-04-201-1/+15
| | | | | | Slightly easier to debug if we can have it only parse one single layout. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* test: print the compiled keymaps to a given directoryPeter Hutterer2021-04-201-2/+35
| | | | | | | | | | | With --keymap-output-dir, the given directory will contain a list of files named after the layout + variant ('us', 'us(euro)', ...) that contain the keymaps for each variant + option combination compiled. This is still a lot, but better to sift through hundreds of keymaps than tens of thousands. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* test: rework the output for the xkeyboard-config layout testerPeter Hutterer2021-04-201-74/+111
| | | | | | | | | | | | | | | | | | | | | | | | The previous output is largely unusable. The result in the CI test runs is a 6GB file with every compiled keymap in it and while we can grep for ERROR, it's not particularly useful. Let's change this and print out YAML instead - that can be machine-processed. This patch adds a new parent class that prints itself in YAML format, the tool invocations are child classes of that class. The result looks like this: Example output: - rmlvo: ["evdev", "pc105", "us", "haw", "grp:rwin_switch"] cmd: "xkbcli-compile-keymap --verbose --rules evdev --model pc105 --layout us --variant haw --options grp:rwin_switch" status: 0 - rmlvo: ["evdev", "pc105", "us", "foo", ""] cmd: "xkbcli-compile-keymap --verbose --rules evdev --model pc105 --layout us --variant foo" status: 1 error: "failed to compile keymap" Special status codes are: 99 for "unrecognized keysym" and 90 for "Cannot open display" in the setxkbmap case. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* test: add proper --verbose handling to the xkeyboard-config testerPeter Hutterer2021-04-201-11/+22
| | | | | | | Instead of defaulting to verbose on/off depending on isatty, make it an argument instead. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>