Branch :
| Author | Commit | Date | CI | Message |
|---|---|---|---|---|
| ca033a29 | 2019-09-03 11:23:14 | rules: add include statements to rules files The majority use-case for extending XKB on a machine is to override one or a few keys with custom keycodes, not to define whole layouts. Previously, we relied on the rules file to be a single file, making it hard to extend. libxkbcommon parses $XDG_CONFIG_HOME/xkb/ but that only works as long as there is a rule that matches the user-specified RMLVO. This works for MLV but not for options which don't have a wildcard defined. Users have to copy the whole rules file and then work from there - not something easy to extend and maintain. This patch adds a new ! include directive to rules files that allows including another file. The file path must be without quotes and may not start with the literal "include". Two directives are supported, %H to $HOME and %S for the system-installed rules directory (usually /usr/share/X11/xkb/rules). A user would typically use a custom rules file like this: ! option = symbols custom:foo = +custom(foo) custom:bar = +custom(baz) ! include %S/evdev Where the above defines the two options and then includes the system-installed evdev rule. Since most current implementations default to loading the "evdev" ruleset, it's best to name this $XDG_CONFIG_HOME/xkb/rules/evdev, but any valid name is allowed. The include functionally replaces the line with the content of the included file which means the behavior of rules files is maintained. Specifically, custom options must be defined before including another file because the first match usually wins. In other words, the following ruleset will not assign my_model as one would expect: ! include %S/evdev ! model = symbols my_model = +custom(foo) The default evdev ruleset has wildcards for model and those match before the my_model is hit. The actual resolved components need only be in one of the XKB lookup directories, e.g. for the example above: $ cat $XDG_CONFIG_HOME/xkb/symbols/custom partial alphanumeric_keys xkb_symbols "foo" { key <TLDE> { [ VoidSymbol ] }; }; partial alphanumeric_keys xkb_symbols "baz" { key <AB01> { [ k, K ] }; }; This can then be loaded with the XKB option "custom:foo,custom:bar". The use of "custom" is just as an example, there are no naming requirements beyond avoiding already-used ones. Also note the bar/baz above - the option names don't have to match the component names. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> | ||
| 1de2f174 | 2019-11-13 13:42:11 | test: let rmlvo-to-kccgst take long options like rmlvo-to-keymap The short options were left for backwards compatibility. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> | ||
| c79c8033 | 2019-11-09 21:25:01 | atom: combine atom_intern() and atom_lookup() Use an "add" bool parameter instead. This simplifies the code a bit. Signed-off-by: Ran Benita <ran@unusedvar.com> | ||
| 2a615593 | 2019-11-08 22:40:13 | test/atom: increase iteration count and print random seed on failure Signed-off-by: Ran Benita <ran@unusedvar.com> | ||
| 2af474e8 | 2019-11-02 13:31:44 | parser: get rid of "stealing" atoms This requires (well, at least implemented by) casting away `const` which is undefined behavior, and clang started to warn about it. The micro optimization didn't save too many allocations, anyway. Signed-off-by: Ran Benita <ran@unusedvar.com> | ||
| 31e561fc | 2019-11-05 13:33:11 | test: remove a superfluous string-is-null check A few lines above we check path_rel[0], so any null pointer will blow up before we get here. Found by coverity Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> | ||
| 96ef14ac | 2019-11-05 13:22:49 | test: fix a potential memory leak Found by coverity Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> | ||
| 3515ba19 | 2019-11-01 10:45:43 | test: xkeyboard-config: bring back the progress bar Signed-off-by: Ran Benita <ran@unusedvar.com> | ||
| 8f93e22a | 2019-11-01 18:41:16 | test: xkeyboard-config: invoke the python3 command (#120) python3 is always python3, but python could be python2 in some cases. Or just missing (e.g. RHEL8). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> | ||
| 0609073c | 2019-11-01 11:09:16 | test: xkeyboard-config: add missing variant tests Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> | ||
| f4a0f738 | 2019-11-01 09:54:29 | test: xkeyboard-config: use universal_newlines instead of decode This way stdin/stdout of the process are opened in text mode and we don't need manually decode. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> | ||
| 7832cc72 | 2019-10-30 12:03:48 | test: xkeyboard-config: flake8 fixes Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> | ||
| cd5a24aa | 2019-10-30 11:22:49 | test: xkeyboard-config: handle keyboard interrupts correctly In python multiprocessing, each process needs to handle (and ignore) the KeyboardInterrupt to avoid exception logging. This is a separate patch for easier reviewing, the first hunks merely re-indent all of the xkbcommontool/xkbcomp functions into a try/except KeyboardInterrupt block. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> | ||
| 9fc0cb87 | 2019-10-30 10:53:58 | test: xkeyboard-config: print to stderr on failure, stdout otherwise This is a change in behavior and requires any automated callers to adjust accordingly. Still, much easier to get the errors that way rather than it being mixed into a thousands-of-lines output file. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> | ||
| f5383847 | 2019-10-29 16:06:10 | test: xkeyboard-config: add a multiprocessing.Pool() to speed up the test Collect all options into a dictionary, then process that as async actions through a process pool. This of course requires collecting the various print statements to avoid mangled output. This dropped the time to completion from around 14 min to 8 min on my local machine (unscientific single run only for the original timing). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> | ||
| 1e131906 | 2019-10-30 11:15:49 | test: xkeyboard-config: use argparse for the path and the tool selection Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> | ||
| 255200fa | 2019-10-28 11:40:56 | test: add test for the various default include paths All tests create a temporary directory, set up the environment for that directory and then check the include paths for the presence of that directory, ideally in the right position of the list. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> | ||
| 45496c33 | 2019-10-19 00:37:48 | test: fix printf("%s", NULL) in error path ../test/common.c: In function ‘test_get_path’: ../test/common.c:171:9: warning: ‘%s’ directive argument is null [-Wformat-overflow=] 171 | fprintf(stderr, "Failed to allocate path (%d chars) for %s\n", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 172 | (int) path_len, path); | ~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Ran Benita <ran@unusedvar.com> | ||
| 076047b2 | 2019-10-16 10:32:19 | keymap-dump: use consistent capitalization for "Group<N>" It's used capitalized everywhere except a couple places. Signed-off-by: Ran Benita <ran@unusedvar.com> | ||
| a6ed0304 | 2019-10-16 10:27:12 | keymap-dump: fix invalid names used for levels above 8 xkbcomp only accepts the "Level" prefix for a level name for levels 1 to 8, but the keymap dumping code added it always, e.g. "Level15". The plain integer, e.g. "8", "15" is always accepted, so just use that. Fixes https://github.com/xkbcommon/libxkbcommon/issues/113 Signed-off-by: Ran Benita <ran@unusedvar.com> Reported-by: progandy | ||
| ab4b4b7f | 2019-07-25 10:12:53 | travis: improve configuration and add macOS Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 7407d311 | 2019-07-25 13:49:41 | test/symbols-leak-test: fix sed regex on macOS Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 97f41fe4 | 2019-07-25 13:24:00 | test/symbols-leak-test: make it work with macOS diff The <() stuff fails with an error: diff: extra operand `/dev/fd/61' Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 6728ebca | 2019-07-25 11:59:07 | test/rmlvo-to-keymap: drop basename usage It wants some libgen.h include which is POSIX only, let's just remove it as it's hardly important. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 32d178b5 | 2019-07-19 02:56:41 | test/rmlvo-to-keymap.c: fix compilation on Darwin (#101) program_invocation_short_name isn't portable. | ||
| 909cc04d | 2019-07-02 13:48:32 | interactive-wayland: Port to stable xdg-shell (#100) xdg_shell v6 was pretty close to the finalised stable version of xdg-shell. We can now just use the stable version, which is supported everywhere (Enlightenment, KWin, Mutter, Weston, wlroots). This requires bumping the wayland-protocols dependency. Signed-off-by: Daniel Stone <daniels@collabora.com> | ||
| 878bc085 | 2018-08-20 16:46:19 | test: allow for absolute paths to be resolved This makes it possible to check a keymap sitting elsewhere than in the test directory. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> | ||
| 16c84cdd | 2018-08-20 15:50:35 | test: drop the rmlvo ability from print-compiled-keymap This is now handled by the rmlvo-to-keymap tool Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> | ||
| d1cb8ad4 | 2018-08-14 11:16:30 | test: add a tool to test-compile all LVO combinations from xkeyboard-config This test contains of two parts: - a simple program to convert RMLVO commandline arguments into a keymap (and print that keymap if requested). - a python script that runs through rules/evdev.xml, and tries to compile a keymap for sort-of every layout/variant/option combination. Sort-of, because we can have multiple options and it really only does one per layout(variant) combination. Same thing can be done using xkbcomp, but right now it doesn't take that as argument, it's hard-coded. This takes quite a while, installing python-tqdm is recommended to see fancy progress bars instead of just miles of dumps. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> | ||
| 5cee660f | 2018-06-23 22:00:19 | keysym-utf: reject out-of-range Unicode codepoints in xkb_keysym_to_utf{8,32} It used to be UTF-8 was defined for inputs > 0x10FFFF, but nowadays that's the maximum and a codepoint is encoded up to 4 bytes, not 6. Fixes: https://github.com/xkbcommon/libxkbcommon/issues/58 Fixes: https://github.com/xkbcommon/libxkbcommon/issues/59 Reported-by: @andrecbarros Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| afea3dd0 | 2018-01-27 20:42:44 | test/interactive-wayland: replace tabs with spaces Match the style of all other files. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 767fa86d | 2017-12-21 14:18:07 | Convert http:// -> https:// where possible Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 29998c25 | 2017-12-12 15:57:58 | test/x11: properly clean up also when skipping test To make valgrind happy. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 6456835f | 2017-12-03 13:04:35 | test/data: sync with xkeyboard-config 2.22 Some tweaks to the de(neo) keyseq tests were required. It seems to have improved. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 14686cd1 | 2017-08-16 20:24:27 | test/interactive-wayland: avoid unused function warning due to configuration test/interactive-wayland.c:95:1: warning: ‘set_cloexec_or_close’ defined but not used [-Wunused-function] Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| fbd86e44 | 2017-08-03 13:38:14 | test/symbols-leak-test.bash: make it easier to read Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 4309735d | 2017-07-31 11:24:28 | build: use top_srcdir consistently Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| d44ba481 | 2017-07-29 22:43:08 | build: remove unneeded preprocessor include flags Better to avoid these unexpected include paths. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| daebdb5e | 2017-07-31 10:18:54 | x11/keymap,test/interactive-evdev: fix a couple of clang-analyzer warnings From my analysis these values cannot be null, but the analyzer cannot see this. So assert it. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 2d964065 | 2017-07-29 23:31:19 | test/x11comp: fix compiler warnings Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 4f17fc60 | 2017-05-27 09:15:26 | Fixed a minor bug in error detection in Wayland test | ||
| c9832d43 | 2017-04-28 09:33:25 | test/interactive-x11: handle NULL from xcb_wait_for_event Can happen in cases like: - There was an error between the error check and the call. - The internal poll() fails. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 5d821aed | 2017-04-11 20:19:15 | test/x11comp: be a bit more careful with kill() We did it correctly but better be safe and appease clang. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 9d941458 | 2017-04-11 20:39:10 | test/interactive-wayland: mark a local function static Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 03f4a03e | 2017-04-11 20:06:01 | test/interactive-wayland: handle unrecognized SHM format The enum seems large, and we don't handle all of the values in it. Previously if we got an unrecognized SHM format we would use an uninitialized `stride`. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 0f43cfa2 | 2017-04-11 20:01:19 | test/interactive-wayland: fix uninitialized `ret` in error path Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 90bd9fdb | 2017-04-11 15:09:50 | interactive-wayland: Port to xdg-shell v6 Mutter only implements v6 now, and Weston also implements that. Port interactive-wayland to this so people can keep on using it. Signed-off-by: Daniel Stone <daniels@collabora.com> | ||
| b5586a6c | 2016-12-02 22:15:19 | keysym: fix locale dependence in xkb_keysym_from_name() We currently use strcasecmp, which is locale-dependent. In particular, one well-known surprise even if restricted just ASCII input is found in the tr_TR (Turkish) locale, see e.g. https://msdn.microsoft.com/en-us/library/ms973919.aspx#stringsinnet20_topic5 We have known to avoid locale-dependent functions before, but in this case, we forgot. Fix it by implementing our own simple ASCII-only strcasecmp/strncasecmp. Might have been possible to use strcasecmp_l() with the C locale, but went the easy route. Side advantage is that even this non-optimized version is faster than the optimized libc one (__strcasecmp_l_sse42) since it doesn't need to do the locale stuff. xkb_keysym_from_name(), which uses strcasecmp heavily, becomes faster, and so for example Compose file parsing, which uses xkb_keysym_from_name() heavily, becomes ~20% faster. Resolves https://github.com/xkbcommon/libxkbcommon/issues/42 Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| babc9e0c | 2016-02-27 22:31:16 | state: add GTK consumed modifiers mode This is more or less what is implemented here: https://git.gnome.org/browse/gtk+/tree/gdk/x11/gdkkeys-x11.c?h=3.19.10#n1131 The implementation here is more technically correct but should provide the same results. Try it out with ./test/interactive-evdev -g (modifiers prefixed with "-" are consumed). https://bugzilla.gnome.org/show_bug.cgi?id=754110 https://github.com/xkbcommon/libxkbcommon/issues/17 Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| a0a41332 | 2016-02-27 19:06:14 | state: allow different modes for calculating consumed modifiers The current functions dealing with consumed modifiers use the traditional XKB definition of consumed modifiers (see description in the added documentation). However, for several users of the library (e.g. GTK) this definition is unsuitable or too eager. This is exacerbated by some less-than-ideal xkeyboard-config type definitions (CTRL+ALT seems to cause most grief...). So, because we - want to enable alternative interpretations, but - don't want to expose too much internal details, and - want to keep things simple for all library users, we add a high-level "mode" parameter which selects the desired interpretation. New ones can be added as long as they make some sense. All of the old consumed-modifiers functions keep using the traditional ("XKB") mode. I mark xkb_state_mod_mask_remove_consumed() and as deprecated without adding a *2 variant because I don't it is very useful (or used) in practice. Alternative modes are added in subsequent commits (this commit only adds a mode for the existing behavior). https://github.com/xkbcommon/libxkbcommon/issues/17 Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 914c060a | 2016-10-22 20:13:11 | test/state: move wrongly-placed assert Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 8978ec39 | 2016-06-09 17:23:55 | test/interactive-wayland: fix control reaches end of non-void function AFAICS there is nothing that can fail directly in this function, so change it to void. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 81ee012a | 2016-06-09 14:52:34 | test/symbols-leak-test: use more portable shebang Some BSDs don't want to give bash the honor of /bin and put it elsewhere. So look it up in PATH instead. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 316c7e24 | 2016-05-05 15:43:59 | test/interactive-wayland: don't ignore asprintf return value Fixes warn_unused_result warning. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| fc41d3d6 | 2016-05-05 15:41:13 | test: use termios instead of system() for disabling terminal echo Takes care of GCC's annoyingly persistent warn_unused_result warnings. But it's better to avoid system() I suppose. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 48d5b44f | 2016-04-12 13:19:25 | interactive-wayland: Valgrind-proofing More meticulously free everything we create, including hooking up the buffer-release callback so we actually free those when required. Make sure seats are actually in the display's seat list. The xkbcommon object-unref functions don't actually require NULL-checking, so we can elide those. Signed-off-by: Daniel Stone <daniels@collabora.com> | ||
| 7e123a10 | 2016-04-12 12:03:32 | test: Add interactive-wayland interactive-wayland is very similar to x11/xev, and dumps out as much state as possible. It provides no titlebar and a completely random cursor, but such is life. Signed-off-by: Daniel Stone <daniels@collabora.com> | ||
| 4c24f7fa | 2016-03-15 20:42:21 | test: assert/ignore some warn_unused_result's Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 37ee8e65 | 2016-03-13 22:56:48 | test/x11comp: fix memory leak Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| fa1b4543 | 2016-03-13 20:56:58 | test: add a test that all symbol version file is updated It is easy to forget to update these files when adding new symbols. Stolen with slight changes from libinput (commit by Marek Chalupa): https://cgit.freedesktop.org/wayland/libinput/commit/?id=a9f216ab47ea2f643f20ed741b741a2b5766eba3 Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 0ce17ef3 | 2016-01-20 11:40:43 | keymap: add xkb_keymap_key_by_name(), xkb_keymap_key_get_name(), tests xkb_keymap_key_by_name() allows finding a keycode from a given keyname and is useful for generating keyboard events to use in regression tests during CI xkb_keymap_key_get_name() is the inverse of xkb_keymap_key_by_name() Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com> [ran: some stylistic tweaks + another test case] Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 91a19905 | 2015-08-24 13:44:20 | test/x11comp: Fix contention between X11 and Xvfb on Mac OS X - Abandon use of -displayfd. - Have x11comp itself look for an unused X11 display number instead. | ||
| 74f85d05 | 2015-08-23 23:02:10 | test/x11comp: remove duplicate FOUR_LEVEL_KEYPAD from test keymap The `test/data/keymaps/host.xkb` file contains a duplicate definition of this type. On my computer (linux, xkbcomp 1.3.0, xserver 1.17.2), the test passes as is, but if I remove the duplicate definition, the roundtrip brings it back and the test fails. I can also reproduce it without relation to the test, by loading `test/data/keymaps/host.xkb` (without the duplicate) using xkbcomp -I $(pwd)/test/data/keymaps/host.xkb $DISPLAY and downloading it again using xkbcomp $DISPLAY out.xkb the duplicate is added. On Mac OS X however, the duplicate is removed (correctly), so the test fails there. xkbcommon itself, which was forked from xkbcomp, doesn't have this bug; in fact, doing ./test/print-compiled-keymap -k keymaps/host.xkb removes the duplicate if it is present. This is (probably) a regression in xkbcomp or xserver compared to the versions used in Mac OS X. Since getting a patch for any of these two is hopeless from my experience, I did not try to investigate further. I am not sure why, but if I also add a `PC_SUPER_LEVEL2` type, the duplicate of `FOUR_LEVEL_KEYPAD` doesn't show up. Hopefully the test will work on all platforms now. https://github.com/xkbcommon/libxkbcommon/issues/26 Reported-by: @nuko8 Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| bdf68803 | 2015-08-23 22:22:11 | test/x11comp: small simplifications xkbcomp doesn't need the search-path argument, since we pass an absolute path. Keep the plain -I which clears the search path just to be sure. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 8e1fed6c | 2015-03-24 16:40:29 | compose: correctly parse modifier syntax As described in: http://cgit.freedesktop.org/xorg/lib/libX11/commit/?id=ddf3b09bb262d01b56fbaade421ac85b0e60a69f Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 74482de6 | 2015-02-03 20:50:52 | test/common: print keycode in decimal not hex Keycodes are usually written in decimal, so hex is hard to compare. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| a0d2b029 | 2014-10-17 01:14:57 | test/keyseq: test 'map[None] = Level2;' scenario See previous commit for an explanation. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 312182ce | 2014-10-16 17:55:46 | test/data: add files for model=applealu_ansi layout=us Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| c6ee6371 | 2014-10-16 17:48:00 | test/data: sync to xkeyboard-config 2.13 (Run ./test/data/sync.sh). Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| c42b8646 | 2014-10-14 11:47:25 | test/compose: test include statement Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 3f489730 | 2014-10-14 10:53:38 | test/compose: test modifier syntax Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 5cefa5c5 | 2014-01-29 13:46:42 | test/interactive-evdev: add compose support To try, do e.g.: sudo ./test/interactive-evdev -l us -v intl -o compose:ralt -d Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 10a7a2bd | 2013-10-27 20:37:27 | test/compose: add new test Some results from the benchmark (compilation of en_US.UTF-8/Compose): $ grep 'model name' /proc/cpuinfo model name : Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz model name : Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz $ uname -a Linux ran 3.16.1-1-ARCH #1 SMP PREEMPT Thu Aug 14 07:40:19 CEST 2014 x86_64 GNU/Linux $ ./test/compose bench compiled 1000 compose tables in 7.776488331s So according to the above benchmark and valgrind --tool=massif, an xkb_compose_table adds an overhead of about ~8ms time and ~130KB resident memory. For contrast, a plain US keymap adds an overhead of ~3ms time and 90KB resident memory. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| bc3b4c08 | 2014-10-02 22:03:28 | Move benchmarks from tests to their own files in bench/ The tests only contain tests, and the benchmarks are more visible. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 68962aa1 | 2014-09-21 23:54:34 | keymap-dump: combine modifier_map's with the same modifier A bit less efficient, but makes for shorter, nicer output. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 24846080 | 2014-09-11 14:08:12 | test/keyseq: add test Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| a931740c | 2014-09-10 13:29:52 | keycodes: fix keymap compilation with no aliases and malloc(0)==NULL If the keymap doesn't have any key-aliases (which is certainly possible), the calloc(num_key_aliases, ...) is allowed to return NULL according to the C standard, but this is not an error. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| ba985629 | 2014-09-06 11:29:15 | test: make most tests portable by copying linux/input.h locally There is really no reason to deny these tests from different platforms only for a few #defines. The only linux-only test (or test program, it is not run by make check) is interactive-evdev, which actually uses evdev. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| e95fb475 | 2014-09-06 11:05:44 | Remove <linux/input.h> include from test/x11comp.c libxkbcommon 0.4.3 introduces a new test, x11comp, which does not build on non-Linux OSes because of the unconditional <linux/input.h> include. This seems not needed even on Linux, so attached there is a simple patch to remove it. https://bugs.freedesktop.org/show_bug.cgi?id=83551 Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| fc95057c | 2014-09-01 17:20:40 | test/x11comp: don't hang if Xvfb is not available If Xvfb is not present, posix_spawn still forks, but the child fails. In that case, since we left the write fd of the pipe open in the parent, we just kept waiting on the read() without noticing that the other side is dead. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| f3597f1b | 2014-08-18 21:03:06 | test/state: add test_update_mask() test Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| a95c4e83 | 2014-08-18 19:47:10 | test/x11comp: server writes \n to displayfd Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 4df720b4 | 2014-08-09 22:14:34 | test/x11-keyseq: new test It is like test/stringcomp, only instead of using xkb_keymap_new_from_string(), it uses xkbcomp to upload the keymap to a dummy Xvfb X server and then xkb_x11_keymap_new_from_device(). If any of these components are not present or fails, the test is shown as skipped. The test is messy, fragile, limited and depends on external tools, but I will improve on that later -- it's better to have a test. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 5058620c | 2014-07-27 16:36:11 | interactive-evdev: don't use sysexits.h Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 40f109af | 2014-07-27 14:24:20 | ast-build: make sure InterpDef is freeable With the following two rules: InterpretDecl : INTERPRET InterpretMatch OBRACE VarDeclList CBRACE SEMI { $2->def = $4; $$ = $2; } ; InterpretMatch : KeySym PLUS Expr { $$ = InterpCreate($1, $3); } | KeySym { $$ = InterpCreate($1, NULL); } ; And the fact that InterpCreate doesn't initialize ->def, if the VarDeclList fails, the %destructor tries to recursively free the uninitialized ->def VarDef. So always initialize it. That was the only problematic code in the parser for %destructor (I'm pretty sure). Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| f5182bbd | 2014-07-26 22:29:22 | test: add file with a syntax error We didn't really have any. It also a exposes a memory leak, since the parser doesn't clean up the AST nodes of the discarded symbols. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 67d884ec | 2014-06-01 15:24:10 | Remove unnecessary !!(expressions) _Bool already does that. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 54174409 | 2014-03-27 17:42:20 | state: fix consumed modifier calculation The current calculation is in short: entry ? (entry->mask & ~entry->preserve) : 0 This changes it be type->mask & ~(entry ? entry->preserve : 0) This is what Xlib does. While less intuitive, it is actually more correct, if you follow this deduction: - The key group's type->mask defines which modifiers the key even cares about. The others are completely irrelevant (and in fact they are masked out from all sided in the level calculation). Example: NumLock for an alphabetic key. - The type->mask, the mods which are not masked out, are *all* relevant (and in fact in the level calculation they must match *exactly* to the state). These mods affect which level is chosen for the key, whether they are active or not. - Because the type->mask mods are all relevant, they must be considered as consumed by the calculation *even if they are not active*. Therefore we use type->mask instead of entry->mask. The second change is what happens when no entry is found: return 0 or just take preserve to be 0? Let's consider an example, the basic type type "ALPHABETIC" { modifiers = Shift+Lock; map[Shift] = Level2; map[Lock] = Level2; level_name[Level1] = "Base"; level_name[Level2] = "Caps"; }; Suppose Shift+Lock is active - it doesn't match any entry, thus it gets to level 0. The first interpretation would take them both to be unconsumed, the second (new one) would take them both to be consumed. This seems much better: Caps is active, and Shift disables it, they both do something. This change also fixes a pretty lousy bug (since 0.3.2), where Shift appears to apparently *not* disable Caps. What actually happens is that Caps is not consumed (see above) but active, thus the implicit capitalization in get_one_sym() kicks in and capitalizes it anyway. Reported-by: Davinder Pal Singh Bhamra Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 3cfa7fda | 2014-03-21 23:00:37 | state: apply control transformation on utf8/utf32 keysym strings This is required by the specification: http://www.x.org/releases/current/doc/kbproto/xkbproto.html#Interpreting_the_Control_Modifier and clients expect this to happen. https://bugs.freedesktop.org/show_bug.cgi?id=75892 Reported-by: Gatis Paeglis <gatis.paeglis@digia.com> Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| b973d71e | 2014-03-21 23:00:17 | state: add xkb_state_key_get_{utf8,utf32}() API functions These functions generally have the same effect as xkb_state_key_get_syms() + xkb_keysym_to_utf{8,32}(). So why add them? - They provide a slightly nicer interface, especially if the string is the only interest. - It makes the handling of multiple-keysyms-to-utf8 transparent. For the designated use-case of multiple-keysyms (unicode combining characters), this is a must. We also validate the UTF-8, which the user might not otherwise do. - We will need to apply some transformation on the resulting string which depend on the xkb_state. This is not possible with the xkb_keysym_* functions. With these functions, the existing xkb_keysym_to_utf{8,32}() are not expected to be used by a typical user; they are "raw" functions. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 2bbaf7c7 | 2014-02-09 13:50:21 | Add utf8.{c,h} for common UTF-8 util functions We need to validate some UTF-8, so this adds an is_valid_utf8() function, which is probably pretty slow but should work correctly. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 6adf17bd | 2014-02-28 15:12:16 | interactive-x11: beef up select_events a bit - Specify in detail which parts of the events we care about. In theory the X server should not bother us with things we didn't ask for. In practice it still does, but oh well. - Use the _aux version of select_events. This is the correct one to use, the non-aux version is useless. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 4fb7b06b | 2014-02-21 18:09:00 | state: Add xkb_state_key_get_consumed_mods This retrieves the mask of consumed modifiers for a given key and state, which is helpful for toolkits without having them to do it one modifier at a time, or pass in 0xFFFFFFFF to xkb_state_remove_consumed_mods to "reverse-engineer" the consumed mods. | ||
| 11a9f76b | 2014-02-15 23:27:23 | keymap-dump: don't print "affect=lock" in PtrLock It's the same as no flags, so might as well not print it. (In fact it is slightly harmful, because it actively *clears* the affect flags, which might have been set in some other manner. But in practice this cannot happen). Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 067c8c25 | 2014-02-10 13:13:26 | test/rmlvo-to-kccgst: use default RMLVO values in translation The tool's supposed to display exactly the same results as the library code. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 973b8fd4 | 2014-02-08 16:40:20 | api: deprecate XKB_MAP_COMPILE_PLACEHOLDER, and use KEYMAP instead of MAP The PLACEHOLDER was not meant to be used, but c++ doesn't like passing 0 to enums, so it was used. For this reason we add all the NO_FLAGS items, so the PLACEHOLDER shouldn't be used anymore. Second, XKB_MAP is the prefix we used ages ago, KEYMAP is the expected prefix here. So deprecate that as well. The old names may still be used through the xkbcommon-compat.h header, which is included by default (no need to include directly). Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 94e0be0d | 2014-02-08 00:42:54 | test/state: fix tautological test test/state.c:376:5: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits] Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 623b10f8 | 2014-02-08 00:27:54 | Fix sign-compare warnings Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 623602cb | 2014-02-07 01:35:56 | test: don't print control characters in interactive tests Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 2f93c788 | 2013-07-30 15:06:40 | x11: add a couple of tests Add two tests: ./test/interactive-x11 which is like test/interactive-evdev, but should behave exactly like your X keyboard and react to state and keymap changes - in other words, just like typing in xterm. Press ESC to exit. ./test/x11 which currently should only print out the same keymap as xkbcomp $DISPLAY out.xkb (modulo some whitespace and some constructs we do not support.) Signed-off-by: Ran Benita <ran234@gmail.com> |