summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Save another GetAtomName round tripUli Schlachter2021-03-093-76/+66
| | | | | | | | | | | | | | | Both get_atom_name() and the new atom interner required a round trip. Move get_atom_name() into the atom interner to save one more round trip. This brings xkb_x11_keymap_new_from_device() down to two round trips, which is the minimum possible number. (Also, I think the new code in keymap.c is more readable than the mess I previously created) With this last commit in the series, this definitely: Fixes: https://github.com/xkbcommon/libxkbcommon/pull/217 Signed-off-by: Uli Schlachter <psychon@znc.in>
* Also batch the XKB GetNames requestUli Schlachter2021-03-091-23/+24
| | | | | | This gets rid of another round trip. Signed-off-by: Uli Schlachter <psychon@znc.in>
* Also batch the XKB-GetMapMap requestUli Schlachter2021-03-091-15/+15
| | | | | | This gets rid of one more round trip. Signed-off-by: Uli Schlachter <psychon@znc.in>
* Remove three more round tripsUli Schlachter2021-03-091-18/+18
| | | | | | | | | | | | | | | There are a number of XKB requests needed to request all the information from the X11 server. So far, the code was sending one request and waiting for the reply. This commit starts batching the request so that we get multiple replies with one round trip. This removes three round trips. Only the simple requests are converted. get_map() and get_names() use some bitmasks that are needed for both the request and the reply. These will be dealt with separately. Signed-off-by: Uli Schlachter <psychon@znc.in>
* Save three more round trips in xkb_x11_keymap_new_from_device()Uli Schlachter2021-03-093-8/+39
| | | | | | | | Instead of asking for an atom name and waiting for the reply four times, this now sends four GetAtomName requests and waits for all the replies at once. Thus, this saves three round trips. Signed-off-by: Uli Schlachter <psychon@znc.in>
* xkb_x11_keymap_new_from_device: Less X11 round-tripsUli Schlachter2021-03-093-104/+157
| | | | | | | | | | | | | | | | | | On my system, calling xkb_x11_keymap_new_from_device() did 78 round trips to the X11 server, which seems excessive. This commit brings this number down to about 9 to 10 round trips. The existing functions adopt_atom() and adopt_atoms() guarantee that the atom was adopted by the time they return. Thus, each call to these functions must do a round-trip. However, none of the callers need this guarantee. This commit makes "atom adopting" asynchronous: Only some time later is the atom actually adopted. Until then, it is in some pending "limbo" state. This actually fixes a TODO in the comments. Fixes: https://github.com/xkbcommon/libxkbcommon/issues/216 Signed-off-by: Uli Schlachter <psychon@znc.in>
* Bump version to 1.1.0xkbcommon-1.1.0Ran Benita2021-02-272-1/+20
| | | | Signed-off-by: Ran Benita <ran@unusedvar.com>
* doc: add keymap-format-text-v1.md to the HTML documentationRan Benita2021-02-272-3/+10
| | | | | | It's incomplete but might be helpful for someone. Signed-off-by: Ran Benita <ran@unusedvar.com>
* doc: add note on variants in rule namesRan Benita2021-02-271-0/+3
| | | | | Fixes: https://github.com/xkbcommon/libxkbcommon/issues/208 Signed-off-by: Ran Benita <ran@unusedvar.com>
* Fix a few keysymtab entries to match their comment in xkbcommon-keysyms.hPierre Le Marre2021-02-271-3/+3
| | | | Signed-off-by: Ran Benita <ran@unusedvar.com>
* scripts: remove meson-junit-report.pyRan Benita2021-02-271-92/+0
| | | | | | Not used since ed5a0b4fede69b8e6dc4db53d97ea4ae0a73956d. Signed-off-by: Ran Benita <ran@unusedvar.com>
* meson.build: replace the remaining join_paths() with the nicer / syntaxPeter Hutterer2021-02-221-1/+1
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* test: add a keysym testerPeter Hutterer2021-02-222-5/+92
| | | | | | | | | | | A simple script that creates a new layout with the given keysym replacing TLDE. Then we compile a keymap and search for the keysym being assigned to TLDE and bail if that fails. The list of keysyms is manually maintained but we only need to add one or two to spot-check whenever the xorgproto is updated. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Fix documentation for XKB_CONFIG_EXTRA_PATHPeter Hutterer2021-02-221-2/+2
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Update keysym definitions to latest xorgprotoPeter Hutterer2021-02-222-3593/+4258
| | | | | | As of xorgproto commit e5d8af9711516385f8346c9e077692b29c914478 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* scripts: update makeheader script for the _EVDEVK keysym definesPeter Hutterer2021-02-221-0/+11
| | | | | | | | | | | | | | | | | | As of xorgproto commit 5dbb5b76597f [1], the 0x10081XXX keycode range is defined for direct evdev kernel keycode mapping. For example, KEY_MACRO1 (0x290) is mapped to 0x10081290. The format of the #define lines for these keys is stable to allow for parsing: #define XF86XK_FooBar _EVDEVK(0x123) /* optional comment */ Update our script so we detect these new lines. Our keysym generation is a two-step process: makeheader and then makekeys. Replacing the key with its full value in the makeheader script means we don't have to update makekeys to handle the _EVDEVK macro and our header file is fully resolved. [1] https://gitlab.freedesktop.org/xorg/proto/xorgproto/-/merge_requests/23 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Update imported comments in xkbcommon-keysyms.hPeter Hutterer2021-02-221-3/+3
| | | | | | Matches xorgproto commits 39eb5974 and 09602b213. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* test: fix interactive evdev test invocationPeter Hutterer2021-01-231-1/+1
| | | | | | | | | rmlvos is the parent list which then fails during a list join because, well, it's a list of lists. Fixes #206 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* test: fill in srcdir/builddir when not set in the environmentPeter Hutterer2021-01-231-2/+13
| | | | | | | Makes this test easier to run from the commandline. Where either of top_srcdir or top_builddir isn't set, fill them in from the CWD or fail otherwise. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* doc/keymap: some slight editingRan Benita2020-12-271-13/+11
| | | | Signed-off-by: Ran Benita <ran@unusedvar.com>
* doc/keymap: add documentation for xkb_symbols (#205)Simon Zeni2020-12-271-3/+103
|
* Bump version to 1.0.3xkbcommon-1.0.3Ran Benita2020-11-232-1/+10
| | | | Signed-off-by: Ran Benita <ran@unusedvar.com>
* keymap-dump: follow xkbcomp in printing affect=both in pointer actionsRan Benita2020-11-233-12/+14
| | | | | | It is equivalent to nothing but good to match up. Signed-off-by: Ran Benita <ran@unusedvar.com>
* x11: fix type level names missingRan Benita2020-11-231-0/+1
| | | | | | | When reading the keymap, the level names would get discarded. Regressed in 26453b84732da870f5695ee347970b337cfea9c1. Signed-off-by: Ran Benita <ran@unusedvar.com>
* test/data: update host.xkb to match keymap-dump styleRan Benita2020-11-231-311/+311
| | | | | | This is needed for fixing the x11comp test. Signed-off-by: Ran Benita <ran@unusedvar.com>
* x11/keymap: fix case with no actionsRan Benita2020-11-231-9/+10
| | | | | | | Possible regression in f41e609bbea8447fc82849a1a6ea0d116189f2f8 (not confirmed yet). Signed-off-by: Ran Benita <ran@unusedvar.com>
* Bump version to 1.0.2xkbcommon-1.0.2Ran Benita2020-11-202-1/+11
| | | | Signed-off-by: Ran Benita <ran@unusedvar.com>
* x11: cache X11 atomsRan Benita2020-11-205-5/+171
| | | | | | | | | | | | | | | | | | | | On every keymap notify event, the keymap should be refreshed, which fetches the required X11 atoms. A big keymap might have a few hundred of atoms. A profile by a user has shown this *might* be slow when some intensive amount of keymap activity is occurring. It might also be slow on a remote X server. While I'm not really sure this is the actual bottleneck, caching the atoms is easy enough and only needs a couple kb of memory, so do that. On the added bench-x11: Before: retrieved 2500 keymaps from X in 11.233237s After : retrieved 2500 keymaps from X in 1.592339s Signed-off-by: Ran Benita <ran@unusedvar.com>
* x11: eliminate slow divisionsRan Benita2020-11-201-22/+23
| | | | Signed-off-by: Ran Benita <ran@unusedvar.com>
* build: combine test & bench internal depsRan Benita2020-11-191-14/+6
| | | | | | No need to duplicate this really. Signed-off-by: Ran Benita <ran@unusedvar.com>
* ci: fix windows CI failure due to add-path deprecationRan Benita2020-11-191-1/+1
| | | | Signed-off-by: Ran Benita <ran@unusedvar.com>
* test: catch unrecognized keysyms in the xkeyboard-config testPeter Hutterer2020-10-201-0/+7
| | | | | | | | | Prompted by https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/merge_requests/127 We run the keymap tool with --verbose which will print the messages from the compiler to the log file as well. And then we can search for the warning regarding an unrecognized keysym and fail our test based on that.
* xkbcomp: where a keysym cannot be resolved, set it to NoSymbolPeter Hutterer2020-10-203-3/+71
| | | | | | | | | | | | | | | | Where resolve_keysym fails we warn but use the otherwise uninitialized variable as our keysym. That later ends up in the keymap as random garbage hex value. Simplest test case, set this in the 'us' keymap: key <TLDE> { [ xyz ] }; And without this patch we get random garbage: ./build/xkbcli-compile-keymap --layout us | grep TLDE: key <TLDE> { [ 0x018a5cf0 ] }; With this patch, we now get NoSymbol: ./build/xkbcli-compile-keymap --layout us | grep TLDE: key <TLDE> { [ NoSymbol ] };
* doc: add note about "short" layout names (#194)Ran Benita2020-10-111-0/+12
| | | | Fixes: https://github.com/xkbcommon/libxkbcommon/issues/193 Signed-off-by: Ran Benita <ran@unusedvar.com>
* Bump version to 1.0.1xkbcommon-1.0.1Ran Benita2020-09-112-1/+12
| | | | Signed-off-by: Ran Benita <ran@unusedvar.com>
* parser: fix another format string for int64_t (#191)hhb2020-09-111-1/+1
|
* tools: align `xkbcli how-to-type` output ourselvesRan Benita2020-09-092-8/+5
| | | | | | | Can possibly add a machine-parsable format if desired, but for now just have it work nicely. Signed-off-by: Ran Benita <ran@unusedvar.com>
* test/tool-option-parsing: skip testing of disabled toolsRan Benita2020-09-082-28/+28
| | | | Signed-off-by: Ran Benita <ran@unusedvar.com>
* test/tool-option-parsing: switch from pytest to unittestRan Benita2020-09-081-196/+173
| | | | | | | | | | | | | For me, installing pytest for libxkbcommon is a bit problematic, so I end up skipping it which is not great. Switch to unittest which is built in to Python. It's not as nice as pytest but good enough in this case. Note: I was too lazy to switch the plain asserts to unittest assertions... Signed-off-by: Ran Benita <ran@unusedvar.com>
* test/tool-option-parsing: keep isolated by using our own test dataRan Benita2020-09-071-1/+6
| | | | | | Make it possible to run the test on all machines. Signed-off-by: Ran Benita <ran@unusedvar.com>
* build: move tests to after toolsRan Benita2020-09-071-129/+130
| | | | | | So tests can refer to stuff set by the tools section. Signed-off-by: Ran Benita <ran@unusedvar.com>
* utils: include unistd.h where we have itPeter Hutterer2020-09-071-1/+1
| | | | | | | MacOS doesn't have eaccess/euidaccess but it does have unistd.h, so let's include it to silence the R_OK redefinition compiler warnings. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* context: fix a compiler warningPeter Hutterer2020-09-071-1/+1
| | | | | | | ../src/context.c:57:9: warning: variable 'err' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* registry: mark the rxkb_log function as attribute printfPeter Hutterer2020-09-071-0/+1
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* ci: enable xkbregistry on macos jobRan Benita2020-09-071-2/+2
| | | | Signed-off-by: Ran Benita <ran@unusedvar.com>
* test: include unstd.h in the registry test to cut down the MacOS warningsPeter Hutterer2020-09-072-0/+6
| | | | | | | mkdtmp, rmdir and unlink are in unstd.h on MacOS. Since including that it doesn't hurt us on Linux, let's do it without ifdefs. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* test/data: add rule registry filesRan Benita2020-09-075-0/+18176
| | | | Signed-off-by: Ran Benita <ran@unusedvar.com>
* test/data: sync from xkeyboard-config 2.30Ran Benita2020-09-0728-863/+1635
| | | | Signed-off-by: Ran Benita <ran@unusedvar.com>
* test/data: change quartz.xkb from CRLF to LFRan Benita2020-09-071-1139/+1139
| | | | Signed-off-by: Ran Benita <ran@unusedvar.com>
* test: fix the xkbcli --version testPeter Hutterer2020-09-071-1/+1
| | | | | | Fixes https://github.com/xkbcommon/libxkbcommon/issues/185 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>