Commit graph

2601 commits

Author SHA1 Message Date
Eberhard Beilharz
24a4146018
chore(linux): Update debian changelog
(cherry picked from commit 8044de4649)
2025-04-04 15:12:57 +02:00
Eberhard Beilharz
8044de4649
chore(linux): Update debian changelog 2025-04-04 15:12:52 +02:00
Eberhard Beilharz
565f1b4dec
Merge pull request #13648 from keymanapp/fix/linux/13647_kbd-details
fix(linux): fix crash if kmp doesn't have name field

Fixes: #13647
Fixes: KEYMAN-LINUX-80
2025-04-04 08:57:49 +02:00
Eberhard Beilharz
d1b74d0175
chore(linux): fall back to package id
This change addresses a code review comment. In the case where the kmp
doesn't contain a name, we now use the `packageID` instead.
2025-04-03 15:56:07 +02:00
Eberhard Beilharz
6d39ab0b06
Merge pull request #13625 from keymanapp/fix/linux/13590_arrow-keys
fix(linux): allow unhandled keys to pass through to compliant apps

This change fixes a bug introduced in #13372. Before that engine.c determined if keys are handled or not. For keys that we didn't handle we returned FALSE. However, that didn't allow the Core to adjust the context where necessary, so #13372 moved that to Core. However, this caused ibus_keyman_engine_process_key_event to return TRUE even if we didn't handle the key. Instead we called ibus_engine_forward_key_event with the non-handled key. This worked in most applications, but not in the Text Editor.

This change now does no longer call ibus_engine_forward_key_event for compliant apps but instead returns FALSE from ibus_keyman_engine_process_key_event for unhandled keys, allowing the app to see and act on the key event.

An 'unhandled' key here is a key that doesn't match a rule in the keyboard and isn't a character key. Core returns a QIT_EMIT_KEYSTROKE action for that key.

Fixes: #13590
2025-04-03 10:26:27 +02:00
Eberhard Beilharz
5df36c05a4
fix(linux): fix crash if kmp doesn't have name field
Fixes: #13647
Fixes: KEYMAN-LINUX-80
2025-04-02 18:20:11 +02:00
Eberhard Beilharz
659e844f83
docs(linux): add function headers for some of the engine methods 2025-04-01 16:46:18 +02:00
Eberhard Beilharz
ac6b521583
docs(linux): clarify the newly added return values
Addresses code review comments.
2025-04-01 16:44:29 +02:00
Eberhard Beilharz
915d30cd95
fix(linux): fix cursor movement
This change fixes a bug introduced in #13372. Before that `engine.c`
determined if keys are handled or not. For keys that we didn't handle
we returned `FALSE`. However, that didn't allow the Core to adjust the
context where necessary, so #13372 moved that to Core. However, this
caused `ibus_keyman_engine_process_key_event` to return `TRUE` even if
we didn't handle the key. Instead we called `ibus_engine_forward_key_event`
with the non-handled key. This worked in most applications, but not
in the Text Editor.

This change now does no longer call `ibus_engine_forward_key_event` for
compliant apps but instead returns `FALSE` from
`ibus_keyman_engine_process_key_event` for unhandled keys, allowing the
app to see and act on the key event.

Fixes: #13590
2025-03-31 17:58:08 +02:00
Eberhard Beilharz
4a9a3dc55f
refactor(linux): remove a warning
The previous code resulted in warnings showing up:
`(ibus-engine-keyman:4276): GLib-CRITICAL **: 14:31:16.030: g_hash_table_lookup: assertion 'hash_table != NULL' failed`.
This should work around the warning.
2025-03-31 16:33:31 +02:00
Marc Durdin
a52437c407 chore: Merge branch 'master' into chore/b18s4-merge-beta-to-master 2025-03-29 05:38:08 +07:00
Eberhard Beilharz
3e3a0dbce1
refactor(linux): mark undocumented keycodes as internal
Several keys that are defined in `winuser.h` were added after Keyman
defined its vkeys and so are not documented in the Keyman docs. This
change adds underscores before and after to mark them as being internal.
It's still useful to have them in the source code because it makes the
mapping between Linux keys and Keyman vkeys easier.

Addresses code review comment.
2025-03-26 16:49:31 +01:00
Eberhard Beilharz
a645fea903
fix(linux): improve key mapping to allow Core to reset context
This change tries to map all keys to corresponding Core VKeys so that
Core sees them and can reset the context if necessary. Previously we
had 0 for most of the keys, which meant that we didn't send them to
Core but instead returned right away. While this doesn't directly fix
the failing user tests described in #12968, it fixes the original tests
in #11172.

Closes: #12968
2025-03-21 18:15:46 +01:00
Eberhard Beilharz
74f3a2a975
fix(linux): improve emitting keystrokes
For some reason when using a LDML keyboard we ended up emitting a
keystroke even though Core returned `FALSE for `emitting_keystroke`.
I wasn't able to track down where this happened, but this change seems
like an easy way to fix it.

This showed up when debugging why the changes in #13372 didn't work for
non-compliant apps.
2025-03-21 09:03:21 +01:00
Eberhard Beilharz
42f7142b41
refactor(linux): rename initialize_queue method
The new name `initialize_queue_items` makes it clearer that we initialize
some items in the queue and not the entire queue (which might still
contain items that we do want to keep).
2025-03-20 18:09:34 +01:00
Eberhard Beilharz
5ccbb65be2
chore(linux): some more replacements of setup.py
The recommended replacement for `setup.py build` is to use the `build`
module, so we have to add this as additional build dependency.

This change also removes the `devdist` target from the makefile - it
isn't referenced in any script, so I think we can do without.

Unfortunately the `python3-build` package available on Ubuntu 22.04 Jammy
is buggy and looks for `/usr/local/bin/python` so we can't use that.
Instead we continue to use `setup.py` for building on Jammy.
2025-03-18 19:57:37 +01:00
Eberhard Beilharz
3346a31115
chore(linux): replace deprecated setup.py
Now that we no longer support Focal we can move to more modern ways of
installing `km-config`. This change removes the deprecated use of
`setup.py` and replaces it with `pip3 install`.

Fixes: #13319
2025-03-17 18:41:25 +01:00
Marc Durdin
39e519c5f5
Merge branch 'epic/linux-mcompile' into chore/merge-master-into-linux-mcompile 2025-03-14 10:58:16 +07:00
Marc Durdin
1a0b830c0b
Merge branch 'master' into chore/b18s3-merge-beta-to-master 2025-03-14 08:54:50 +07:00
Marc Durdin
f7bed1d2f6 chore(common): update tests where region data has been added
The 2025-02-18 release of langtags.json includes tag data for sa-Latn
and he-Latn, so tests related to those tags now need to account for
region.

Fixes: #13288
2025-03-10 09:33:01 +07:00
Darcy Wong
1380597be2
Merge branch 'beta' into chore/common/crowdin-vi 2025-03-05 19:45:39 +07:00
Eberhard Beilharz
8d5fe8a66a
Merge branch 'master' into chore/linux/cherry-pick/changelog 2025-03-03 08:10:17 +01:00
Marc Durdin
81560c3612
Merge branch 'epic/linux-mcompile' into chore/merge-master-into-linux-mcompile 2025-03-01 16:01:48 +07:00
Marc Durdin
f61a104acf
Merge branch 'master' into chore/merge-beta-into-master-B18S2 2025-03-01 15:45:19 +07:00
Eberhard Beilharz
2999dba94c
chore(linux): Update debian changelog 2025-03-01 09:39:53 +01:00
Eberhard Beilharz
5a58410312
chore(linux): Update debian changelog 2025-03-01 09:38:05 +01:00
Eberhard Beilharz
097a416a06
Merge pull request #13363 from keymanapp/fix/linux/13282_fcitx5-configtool
fix(linux): ignore exception when fcitx5-configtool is not found
2025-02-27 17:14:20 +01:00
Eberhard Beilharz
788e778645
Merge pull request #13356 from keymanapp/fix/linux/12902_UninstallException
fix(linux): ignore DBusException during install and uninstall
2025-02-27 15:28:52 +01:00
Eberhard Beilharz
d90b718aa5
fix(linux): ignore exception when fcitx5-configtool is not found
Fixes: #13282
Fixes: KEYMAN-LINUX-7S
2025-02-27 11:12:30 +01:00
Eberhard Beilharz
749039b120
chore(linux): update to current Debian policy version 2025-02-27 10:02:16 +01:00
Eberhard Beilharz
a35c6b3c29
Merge pull request #13355 from keymanapp/refactor/linux/tests
refactor(linux): extract method for setting up mocks in tests
2025-02-27 08:37:20 +01:00
Eberhard Beilharz
6fe916ca8b
fix(linux): ignore DBusException during install and uninstall
Fixes: #12902
Fixes: #13283
Fixes: KEYMAN-LINUX-7J
Fixes: KEYMAN-LINUX-7R
2025-02-26 18:24:27 +01:00
Eberhard Beilharz
a4492963e9
refactor(linux): improve dbus_util.py code 2025-02-26 17:19:09 +01:00
Eberhard Beilharz
3e09884c68
chore(linux): adjust to renamed xdg module
The `xdg` module got renamed to `xdg_base_dirs`. However, Ubuntu still
ships the `python3-xdg` package with the old module, so we'll have to
support both so that it'll work with both Ubuntu packages and in a
virtual environment.
2025-02-26 12:14:00 +01:00
Eberhard Beilharz
615d90765c
refactor(linux): extract method for setting up mocks in tests 2025-02-26 12:01:54 +01:00
Eberhard Beilharz
2c7cd3a8d2
chore(linux): Update to new Debian policy version 2025-02-22 12:22:34 +01:00
Darcy Wong
1a1056ca50 chore(common): Add crowdin strings for Vietnamese 2025-02-22 07:37:36 +07:00
Eberhard Beilharz
3d77fe7492
fix(linux): address compiling with ICU 76
Turns out that Keyman 18 already compiles with ICU 76, so the only thing
left to do is mark the Debian bug as being closed by this change.

Fixes: #12920
2025-02-19 17:25:02 +01:00
Eberhard Beilharz
11694db9e3
Merge pull request #13234 from keymanapp/refactor/linux/13204_enable-integration-tests
refactor(linux): re-enable integration tests 🕷️
2025-02-19 11:54:27 +01:00
Eberhard Beilharz
ca96a8c38d
chore(linux): address code review comments 2025-02-19 10:59:44 +01:00
Eberhard Beilharz
30224a1b41
Merge pull request #13248 from keymanapp/refactor/linux/cleanup-tests
refactor(linux): cleanup code of test fixture 🕷️
2025-02-17 17:11:52 +01:00
Eberhard Beilharz
366ce9c1fb
Merge pull request #13247 from keymanapp/chore/linux/improve-test-messages
chore(linux): improve output when running tests 🕷️
2025-02-17 17:11:34 +01:00
Eberhard Beilharz
becff26e19
Merge pull request #13233 from keymanapp/chore/linux/improve-tests
feat(linux): add `--remote-debug` flag to `run-tests.sh` script  🕷️
2025-02-17 17:11:05 +01:00
Eberhard Beilharz
0c2d8f0312
refactor(linux): changes to get integration tests working
This change contains various changes and refactorings which together
allows the integration tests to pass again.

One of the important changs is `DbusTestHelper` which listens to a DBus
signal for a sentinel message and then simulates the sentinel key press.
Getting this to work also requires processing sd-bus messages which hooks
into the glib event loop and is implemented in `EventSource`.

Fixes: #13204
2025-02-14 17:30:42 +01:00
Eberhard Beilharz
e4c7332e1c
refactor(linux): use OrderedOutputDeviceMock when running tests
When running tests we use the `OrderedOutputDeviceMock` class which sends a
dbus message for a sentinel key press instead of creating/using a real
"virtual" keyboard.
2025-02-14 16:42:08 +01:00
Eberhard Beilharz
44eb85f433
chore(linux): Revert "refactor(linux): temporarily ignore integration tests"
This reverts commit 3a72e56c75.
2025-02-14 16:42:07 +01:00
Eberhard Beilharz
84df966c38
refactor(linux): cleanup code of test fixture 2025-02-14 16:35:06 +01:00
Eberhard Beilharz
937f799d23
chore(linux): update message when running tests 2025-02-14 16:34:27 +01:00
Eberhard Beilharz
af99c1d668
chore(linux): improve the output if dependencies are missing 2025-02-14 16:31:12 +01:00
Eberhard Beilharz
051e6c7b1b
feat(linux): add --remote-debug flag to run-tests.sh script
This allows to run the tests in a VM and debug them remotely.

Co-authored-by: Darcy Wong <darcy_wong@sil.org>
2025-02-14 16:29:41 +01:00