Commit Graph

1664 Commits (8ce81c0607da0d821bb79bcac7c7a07d9f863a42)

Author SHA1 Message Date
Ran Benita 8ce81c0607 README,PACKAGING: use the new meson unified command format
Signed-off-by: Ran Benita <ran234@gmail.com>
2017-12-15 16:18:14 +02:00
Ran Benita 5c9042127f build: disable -Wdocumentation-deprecated-sync
We will never remove the deprecated functions and there is no real
reason to annoy users into stop using them.

If there *will* be a reason, *then* we will add the attribute.

Fixes: https://github.com/xkbcommon/libxkbcommon/issues/56
Signed-off-by: Ran Benita <ran234@gmail.com>
2017-12-14 17:56:18 +02:00
Ran Benita 10e1a1b1aa travis: ensure all tests are valgrind-clean
The tests will fail if they have any memory leaks or perform invalid
accesses.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-12-12 15:58:32 +02:00
Ran Benita 29998c258c test/x11: properly clean up also when skipping test
To make valgrind happy.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-12-12 15:58:32 +02:00
Ran Benita 47f45194e4 compose/parser: be more careful when checking if sequence overrides or duplicates another
Signed-off-by: Ran Benita <ran234@gmail.com>
2017-12-12 15:45:37 +02:00
Ran Benita 2963e29f0e xkbcomp/ast-build: fix memory leak when appending multi-keysyms
`syms` was not freed.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-12-12 14:44:01 +02:00
Ran Benita 26453b8473 keymap: fix NULL dereference when dumping the default fallback type
The default fallback type uses
    type->level_names = NULL
but the keymap-dump code was not checking this case.

Instead of adding more workarounds and possible bugs (e.g. previous
commit), let's just keep the number of level names separately. This has
the additional advantage retains extraneous level name if someone adds
them for some reason.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-12-12 14:33:24 +02:00
Ran Benita 9f85d6b78c xkbcomp/types: fix types being assigned the wrong number of levels in some circumstances
The buggy code assigned the number of levels based on the number of
level names in the definition, instead of the actual number of levels!
This would completely break type definitions which do not give names to
levels.

This was not noticed for so long because xkeyboard-config always gives
names to all levels.

This regressed in 61fed8dab9.

Reported-by: Gatis Paeglis <gatis.paeglis@qt.io>
Signed-off-by: Ran Benita <ran234@gmail.com>
2017-12-12 14:08:01 +02:00
Ran Benita 18d6aebec0 keysym: add xkb_keysym_to_{lower,upper} to public API
These can be useful in some odd cases.

There is already an implementation (+ tests) for internal use, so all
that's needed is to export them.

If xkbcommon were to provide a way to convert a Unicode codepoint to a
keysym, this could have been implemented externally as follows:

    uint32_t codepoint = xkb_keysym_to_utf32(keysym);
    uint32_t upper_codepoint = my_unicode_library_to_upper(codepoint);
    xkb_keysym_t upper_keysym = theoretical_xkb_keysym_from_utf32(upper_codepoint);

However keysym -> codepoint is not injective so such a function is not
possible strictly speaking.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-12-11 23:01:18 +02:00
Ran Benita 6456835f1c 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>
2017-12-03 13:07:21 +02:00
Ran Benita 8db924b87d Merge pull request #53 from whitslack/missing-ucs-codes
keysym-utf: Add missing codes for signifblank and permille keysyms
2017-10-03 13:28:32 +03:00
Matt Whitlock 0db1d3131a keysym-utf: Add missing codes for signifblank and permille keysyms 2017-09-28 21:31:28 -04:00
Ran Benita 5eeba0fe0d build/meson: require meson >= 0.41.0
With previous versions, the compilation fails with linker errors.

Fixes https://github.com/xkbcommon/libxkbcommon/issues/52
Reported-by: @rezso
Signed-off-by: Ran Benita <ran234@gmail.com>
2017-09-10 09:18:54 +03:00
Ran Benita 41f1018897 expr: paper over a maybe-uninitialized warning
Signed-off-by: Ran Benita <ran234@gmail.com>
2017-09-08 12:16:13 +03:00
Ran Benita 14686cd1a8 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>
2017-08-16 20:24:27 +03:00
Ran Benita 76348754e3 build: add missing configure function checks for test/interactive-wayland
Signed-off-by: Ran Benita <ran234@gmail.com>
2017-08-16 20:23:54 +03:00
Ran Benita f468f0b243 xkbcommon-compose.h: change recommended locale fallback code to treat empty string same as unset
The previous code would cause failures to find the Compose file if one
of the environment variables LC_ALL, LC_CTYPE or LANG are set to the
empty string.

The description of the fallback procedure in loclale(7) talks about
"non-null environment variable"; I interpreted this to mean the
environment variable is unset, but it actually means unset or empty (I
verified this by looking at what glibc and musl do).

A recent bug in systemd https://github.com/systemd/systemd/issues/6407
exposed this issue. It causes these these variables to be set to the
empty string in TTY sessions.

Reported by "doodoo" in https://bbs.archlinux.org/viewtopic.php?id=228658

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-08-13 18:03:57 +03:00
Ran Benita ba9568bdb1 Bump version to 0.7.2
Signed-off-by: Ran Benita <ran234@gmail.com>
2017-08-04 16:28:36 +03:00
Ran Benita c99f6a5821 Update NEWS
Signed-off-by: Ran Benita <ran234@gmail.com>
2017-08-04 16:28:14 +03:00
Ran Benita 5c2da7795c build/autotools: fix doc installation
Signed-off-by: Ran Benita <ran234@gmail.com>
2017-08-04 15:43:13 +03:00
Ran Benita fbd86e44ad test/symbols-leak-test.bash: make it easier to read
Signed-off-by: Ran Benita <ran234@gmail.com>
2017-08-03 13:38:14 +03:00
Ran Benita 2a16c3c482 build/autotools: fix symbol versioning configure check
Regressed in 4309735. I thought `$top_srcdir` works in configure too,
apparently not!

See: https://github.com/xkbcommon/libxkbcommon/issues/50#issuecomment-319693694

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-08-02 18:34:29 +03:00
Ran Benita c665b45011 build/autotools: make doxygen's input relative
Was meant to be a part of 41bea9a.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-08-02 18:26:19 +03:00
Ran Benita cd642b27ac build/autotools: dist the meson build files
So that it's possible to build with meson from autotools-generated
tarballs.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-08-01 23:36:33 +03:00
Ran Benita fd82b89eb9 build/autotools: install documentation under html/
To be consistent with the meson build; also makes more sense as doxygen
can generate more than html (though we currently are not doing that).

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-08-01 23:35:22 +03:00
Ran Benita 41bea9ab2b build: make doxygen run from the source tree
I couldn't find any other way to make this work!

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-08-01 23:32:15 +03:00
Ran Benita ccc3415edd Merge pull request #49 from bluetech/meson
build: add meson build system
2017-07-31 20:57:31 +03:00
Ran Benita 86434d8498 build: add meson build system
Meson is easier to maintain, much faster, encourages better practices,
and is not built on a pile of shell scripts.

The autotools build system is kept intact for now, in order to ease the
migration. The intention is to remove it sooner rather than later, if
all goes well.

Run `meson build && mesonconf build` to see the configuration options
for the new system. Conversion should be straightforward. Environment
variables like CFLAGS work the same.

If meson is used, xorg-util-macros is not required.

In terms of functionality the two systems have about the same
capabilities. Here are some differences I noticed:

- Meson uses `-g` by default, autotools uses `-g -O2`.

- In autotools the default behavior is to install both static and shared
  versions of the libraries. In meson the user must choose exactly one
  (using -Ddefault_library=static/shared).

  It is possible to workaround if needed (install twice...), but
  hopefully meson will add the option in the future.

- Autotools has builtin ctags/cscope targets, meson doesn't.

  Easy to run the tools directly.

- Meson has builtin benchmarks target. Handy.

- Meson has builtin support for sanitizers/clang-analyzer/lto/pgo/
  coverage etc. Also handy.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-07-31 20:53:39 +03:00
Ran Benita 75ec764cee build: remove Android.mk
I don't think it will work with meson, and I also don't think anyone is
using it.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-07-31 18:28:28 +03:00
Ran Benita 2f6616a571 build: remove -uninstalled pkg-config files
Meson doesn't support them directly, and I don't think anyone is using
them.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-07-31 18:28:28 +03:00
Ran Benita a0c858cda1 travis: do the build out-of-tree
To catch problems like the previous commit.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-07-31 18:22:54 +03:00
Ran Benita 993f4837ad build: fix out-of-tree build
The change in d44ba48 removed -I$(top_builddir)/src/xkbcomp, but this is
needed in order to find the generated parser.h file which is put in the
build dir.

I also added -I$(top_builddir)/src in order to match the meson behavior.

Fixes https://github.com/xkbcommon/libxkbcommon/issues/50

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-07-31 18:20:58 +03:00
Ran Benita 4309735de3 build: use top_srcdir consistently
Signed-off-by: Ran Benita <ran234@gmail.com>
2017-07-31 15:55:48 +03:00
Ran Benita 4983dbcf43 build: change doxygen target to be properly dependency-based
This hackery (thanks libinput) is clearer and more precise than the
previous hackery.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-07-31 15:55:48 +03:00
Ran Benita 0a19267f30 build: move custom targets to scripts/ and remove from makefile
These scripts generate source code that is committed to git and hence do
not really belong in the build system. A maintainer runs them as needed.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-07-31 15:55:48 +03:00
Ran Benita 00b08eae82 build: rewrite the update-keysyms sed script in python
A bit more manageable this way, and the other part of the target is
already using python.

The output is the same, except I removed the reference to Makefile.am.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-07-31 15:55:48 +03:00
Ran Benita d44ba481d7 build: remove unneeded preprocessor include flags
Better to avoid these unexpected include paths.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-07-31 15:55:48 +03:00
Ran Benita 1b6fa0298a build: explain why we don't AC_DEFINE a couple of constants
Signed-off-by: Ran Benita <ran234@gmail.com>
2017-07-31 15:55:48 +03:00
Ran Benita daebdb5e08 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>
2017-07-31 15:55:48 +03:00
Ran Benita 2d9640651a test/x11comp: fix compiler warnings
Signed-off-by: Ran Benita <ran234@gmail.com>
2017-07-31 15:55:48 +03:00
Ran Benita 42f800175d Merge pull request #48 from namandixit/patch-1
Fixed a minor bug in error detection in Wayland test
2017-05-27 12:23:27 +03:00
Naman Dixit 4f17fc6005 Fixed a minor bug in error detection in Wayland test 2017-05-27 09:15:26 +00:00
Ran Benita ca12d2fdd3 Merge pull request #46 from jwrdegoede/master
Sync Keysyms with recent xproto additions
2017-05-12 14:48:47 +03:00
Hans de Goede 939d0909a4 Sync Keysyms with recent xproto additions
xproto recently has been extended with 4 new keysyms:
XF86XK_Keyboard
XF86XK_WWAN
XF86XK_RFKill
XF86XK_AudioPreset

This commit is the result of running "make update-keysyms" on a system
with the updated xproto installed.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2017-05-12 12:27:05 +02:00
Ran Benita 148aec8bdf doc/compat: correct the XKB protocol version from 1.1 to 1.0
There is no XKB 1.1!

Thanks to Oded Arbel for catching this.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-04-29 15:26:38 +03:00
Ran Benita c9832d4374 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>
2017-04-28 09:33:25 +03:00
Ran Benita 6b57344c32 state: cure boolean blindness in the filter functions' result
Makes it a little easier to understand the filters.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-04-27 20:06:21 +03:00
Ran Benita 927fd8f89a state: remove unneeded NULL check
xkb_filter_new() cannot return NULL.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-04-27 19:17:53 +03:00
Ran Benita d44c3ab28e state: reorder new() functions before the set() functions in the code
So that they may be read more naturally in chronological order.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-04-27 19:16:04 +03:00
Ran Benita 5d821aed9b 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>
2017-04-11 21:01:41 +03:00