Commit graph

223 commits

Author SHA1 Message Date
Marc Durdin
deeb246783
Merge pull request #7084 from keymanapp/fix/linux/improvecontext
fix(linux): Improve setting context
2022-10-26 12:34:24 +11:00
Marc Durdin
5321538d1d
Merge pull request #7503 from keymanapp/chore/linux/clearify
chore(linux): call `reset_context` instead of `...focus_in`
2022-10-25 06:23:42 +11:00
Eberhard Beilharz
7b3f891eb9
chore(linux): Rename internal method to commit_string
The previous method name `ibus_keyman_engine_commit_string`
suggests that this method is overridden from ibus-engine class.
However, while it is true that ibus-engine has a
`ibus_engine_commit_string` method it can't be overridden. This
change renames the method to make it clearer that this is an internal
method that won't be called by ibus.
2022-10-20 09:34:28 +02:00
Eberhard Beilharz
e529052dc5
chore(linux): call reset_context instead of ...focus_in
Both `ibus_keyman_engine_reset` and `ibus_keyman_engine_focus_in`
are methods that get called by ibus. Having `ibus_keyman_engine_reset`
call `ibus_keyman_engine_focus_in` makes it much harder to see in
log files which methods get really called by ibus.

This change replaces the call of `...focus_in` with `reset_context`,
which is what `...focus_in` does as well. The only other thing that
`ibus_keyman_engine_focus_in` does in addition to that is calling
`ibus_engine_register_properties` - which shouldn't be necessary on
a reset (besides that we don't seem to do anything with the one
status property we register).
2022-10-20 09:22:11 +02:00
Eberhard Beilharz
cfe0998b2e
refactor(linux): Comment unused methods
Closes #7297.
2022-10-20 09:06:27 +02:00
Eberhard Beilharz
448baad79d
refactor(linux): Replace tabs with spaces 2022-10-20 09:02:48 +02:00
Eberhard Beilharz
d4283754df
refactor(linux): Refactor alignment of params 2022-10-20 09:02:48 +02:00
Eberhard Beilharz
2dab491a10
chore(linux): Always output function name in debug messages 2022-10-20 08:56:58 +02:00
Eberhard Beilharz
2663aa738c
chore(linux): Improve debug output 2022-10-20 08:56:36 +02:00
Eberhard Beilharz
f4410616e8
fix(linux): Fix tests
The previous changes didn't work when we output a character +
deadkey. In response to outputting the character we get a
`ibus_keyman_engine_set_surrounding_text` call in which we
called `reset_context` which removed the deadkey marker. This change
fixes this problem by comparing the surrounding text with the
context we already have. Only if it's different we reset the
context.
2022-10-17 20:27:04 +02:00
Eberhard Beilharz
696f683d0e
chore(linux): address code review comments 2022-10-13 11:13:28 +02:00
Eberhard Beilharz
d2262f2223
refactor(linux): Some refactorings
- adjust indentation of `reset_context`
- move variable definition to block where they're used
- make use of method to detect surrounding text support
2022-10-12 21:19:10 +02:00
Eberhard Beilharz
bad0feea9b
fix(linux): Improve setting context
This change always gets the context from the surrounding text
if `reset_context` gets called. This helps when the user puts the
IP after a certain character. Previously we basically lost the
context, with this change we restore the context so that it's like
the user just typed the previous characters.
2022-10-12 21:14:26 +02:00
Eberhard Beilharz
bcd29634bf
feat(linux): Address code review comments
Co-authored-by: Marc Durdin <marc@durdin.net>
2022-10-11 18:44:30 +02:00
Eberhard Beilharz
908dfbeefb
feat(linux): Optimize if surrounding text is supported
Only send fake event if client does not support surrounding text.
2022-10-11 18:44:30 +02:00
Eberhard Beilharz
e6601f205c
feat(linux): match state of original event when creating fake event
We forward a fake event for both keydown and keyup. This change
will set the flag on the fake event so that we get keydown and keyup.
This is probably not technically necessary, but it helps in
debugging because you can then see that both fake events still
belong to the same keypress.
2022-10-11 18:44:30 +02:00
Eberhard Beilharz
dba2002287
feat(linux): Still support older ibus versions
If we're dealing with an older ibus version that doesn't have the
necessary patches we fall back to the old behaviour. Otherwise
we use the new output reordering.
2022-10-11 18:44:29 +02:00
Eberhard Beilharz
e1d4169eeb
feat(linux): Optimizations 2022-10-11 18:44:29 +02:00
Eberhard Beilharz
18d0711ff3
fix(linux): Fix reordering of output
This change implements a commit queue which allows to control the
order of the output. This ensures that any backspace we generate
will be processed before the character we're adding.

Requires changes in ibus (surrounding text fix (see #7072) and
prefilter change)

Fixes #1489, #4028, #4029, #4030, #4505, #5510, #6639
2022-10-11 18:44:28 +02:00
Eberhard Beilharz
efbfaa1be4
chore(linux): Cleanup unnecessary surrogate check
Previously `process_unicode_char_action` checked for
`action_item->character` being a surrogate. This should never happen
because `action_item->character` is a 32-bit character. This change
removes the unnecessary check and the `keyman->firstsurrogate` field.

Fixes #6385.
2022-10-04 19:24:58 +02:00
Eberhard Beilharz
af6c6db49a
chore(linux): Remove unused IBusLookupTable 2022-09-15 18:53:44 +02:00
Marc Durdin
895ce930a0
Merge pull request #6993 from keymanapp/chore/core/rename-json-source
chore(core): rename json.hpp to jsonpp.hpp 🛩
2022-08-29 14:48:32 -05:00
Eberhard Beilharz
7169723d54
fix(linux): Remove wrong ok_for_single_backspace method
The implementation of `ok_for_single_backspace` checked the current
action_item multiple times. However, we already know that that
item is `KM_KBP_IT_BACK` because the only place this method gets
called is from the `process_backspace_action` method. So basically
this method always returns `FALSE`. "Fixing" this method to check
the next action_items makes things fail.

Removing this method since it doesn't do anything except burn
processing cycles...

Fixes #5614.
2022-08-25 18:38:06 +02:00
Marc Durdin
e30871f01e chore(linux): add common/include to further paths 2022-08-11 14:56:46 +02:00
Marc Durdin
600f6bfec4 chore(linux): update include paths 2022-08-11 13:18:28 +02:00
Marc Durdin
b5bddc025f chore(core): rename json.hpp to jsonpp.hpp
The name json.hpp conflicts with the JSON for Modern C++ library that
is also used by Developer. Renames json.hpp and json.cpp to jsonpp.hpp
and jsonpp.cpp aka "JSON Pretty Printer".
2022-07-26 13:06:16 +10:00
Marc Durdin
d5aa61fdc0 chore(common): Merge branch 'chore/web/keyman-version-for-developer' into chore/common/move-common-core-desktop-to-core 2022-05-30 09:38:27 +10:00
Marc Durdin
4ab3c53810 chore(common): adjust scripts for core relocation 2022-05-18 07:22:11 +10:00
Eberhard Beilharz
acd0a252b0
chore(linux): Fix failure in Debian reproducibility testing
Debian reproducibility testing runs a slightly different package
build that seemingly doesn't set the `DEB_BUILD_MULTIARCH` variable.
This change introduces our own environment variable to detect
package builds so that we can skip the ibus-keyman integration
tests that require running an X server.
2022-04-20 16:50:38 +02:00
Eberhard Beilharz
aa7537730a
feat(linux): Allow to run ibus tests on Wayland
This change modifies the `run-tests.sh` script so that tests
run on both Wayland (if supported) and X11 unless
`--no-wayland` or `--no-x11` is specified.

This change also adds the new argument `--wayland` to the
`ibus-keyman-tests` executable which runs the tests under
Wayland.

Note that running Wayland tests is only possible in Ubuntu 21.10+
because it requires a version of `mutter` that supports the
headless option which got added in mutter 40.
2022-03-31 17:52:50 +02:00
Eberhard Beilharz
cab9ced56d
chore(linux): Update copyright 2022-03-14 12:08:09 +01:00
Eberhard Beilharz
4cad24cac3
chore(linux): Fix lintian warnings 2022-03-10 20:30:44 +01:00
Eberhard Beilharz
d9e4ad7899
feat(linux): add support for Wayland
This allows to use Keyman with the Wayland display server.
One thing that doesn't yet work completely with this change is
caps-lock.

Partially implements #4273.
2022-01-20 19:21:57 +01:00
Eberhard Beilharz
ae9cb97ce6 fix(linux): Improve ibus-keyman tests
This change will hopefully help some tests that occasionally fail
on TC. After setting the options during the test setup we sync the
settings before running the test scenario.
2021-12-14 14:10:58 +01:00
Eberhard Beilharz
855cb9d916
refactor(linux): Refactor two core tests
This change refactors two tests to no longer rely on obscure internal
knowledge. This allows the tests to also run in ibus-keyman.
2021-12-03 17:23:36 +01:00
Eberhard Beilharz
e31cf4a1d8
chore(linux): add non-surrounding-text feature to tests
This also fixes a failing test (`048 - modifier keys keep context`)
if surrounding text is not supported. If the user presses the
capslock key we shouldn't reset the context if no rules match.

Fixes #5613.
2021-12-03 17:23:35 +01:00
Eberhard Beilharz
30897811c0
Merge pull request #5966 from keymanapp/fix/linux/tests
fix(linux): Fix ibus-keyman integration tests 🎫
2021-11-29 09:55:30 +01:00
Ross
b54be8aa9b feat(windows): add kmx_conversion.cpp to test Makefile.am 2021-11-29 10:56:53 +10:00
Eberhard Beilharz
37e20c5cbb
fix(linux): Fix ibus-keyman integration tests
Previously we overwrote our test data, so we basically ran the same
test repeatedly under different names.

Properly running them showed some failures which this change also
fixes or skips.
2021-11-24 15:59:44 +01:00
Eberhard Beilharz
f1dcb71127
chore(linux): Run ibus-keyman tests as part of build
Part of #5613.
2021-11-22 15:40:37 +01:00
Eberhard Beilharz
07fb8084ee
chore(linux): Fix unit tests
Array has to be NULL terminated.
2021-11-22 15:40:17 +01:00
Eberhard Beilharz
65d1a3f9a0
chore(linux): Improve run-tests.sh script
Part of #5613.
2021-11-22 15:40:17 +01:00
Eberhard Beilharz
b9428c9ae8
chore(linux): Remove unused test methods
This change removes the pre-edit related test methods since we
don't use the pre-edit option.
2021-11-19 15:10:56 +01:00
Eberhard Beilharz
8f708a55e2
Merge pull request #5883 from keymanapp/chore/linux/comments
chore(linux): Update method comments
2021-11-16 07:55:54 +01:00
Eberhard Beilharz
d8ee425eb2
chore(linux): fix memory allocation in keymanutil.c
Also add unit tests for keyman_put_options_todconf.
2021-11-15 19:22:04 +01:00
Eberhard Beilharz
642bad8d7d
fix(linux): fix freeing of options 2021-11-08 12:38:00 +01:00
Eberhard Beilharz
be7dd09cb0
chore(linux): Address code review comments 2021-11-08 12:02:30 +01:00
Eberhard Beilharz
16ebd7e653
Merge pull request #5884 from keymanapp/chore/linux/5613-unittests
chore(linux): fix failing ibus-keyman tests 🎫
2021-11-08 10:16:32 +01:00
Eberhard Beilharz
65fc5efce5
Merge pull request #5885 from keymanapp/chore/linux/removetests
chore(linux): cleanup defunct tests 🎫
2021-11-08 10:15:35 +01:00
Eberhard Beilharz
5e6585717d chore(linux): fix run-tests.sh script
Part of #5613.
2021-11-05 22:35:09 +01:00