Commit graph

27 commits

Author SHA1 Message Date
Marc Durdin
f55218fec6 chore: Merge remote-tracking branch 'origin/epic/web-core' into auto/A19S35-merge-base-into-web-core 2026-08-14 17:19:28 +02:00
rc-swag
f8be03cf8b fix(core): fix typo plus temp remove null check 2026-08-11 16:59:10 +10:00
rc-swag
16e6a5634c fix(core): make coherence check a debug assert
This also adds a null pointer check to KM_CORE_IT_PERSIST_OPT
case in km::core::action_item_list_to_actions_object

Fixes: #16340
2026-08-11 16:23:56 +10:00
Marc Durdin
0e0c0be70d chore: Merge remote-tracking branch 'origin/epic/web-core' into auto/A19S34-merge-base-into-web-core 2026-08-10 11:58:50 +02:00
rc-swag
eb19c28ab9 fix(windows): comments and formating 2026-07-23 22:16:17 +10:00
rc-swag
a07fff8be3 fix(windows): change option_stack to deque
when vectors are resized the memory is realocated so all the option
pointers become invalid. Using a deque avoids this it has all the same
methods so it is straight replacement.

fixes: #15961
2026-07-23 21:52:32 +10:00
Marc Durdin
3d65485ebd chore: Merge branch 'epic/web-core' into auto/A19S29-merge-master-into-web-core
Note: rewrote state_api.tests.cpp change to match new unit test pattern.
2026-05-22 11:32:24 +02:00
rc-swag
49e222c273 fix(windows): actions list copy constructor
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
2026-05-18 21:07:30 +10:00
rc-swag
c0a29a32f7 fix(core): remove white space and comments
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
2026-05-14 16:28:59 +10:00
rc-swag
33cddff16e fix(windows): deep copy for state object
This commit update the state object to have a deep copy for the
action_struct member. The tests have been modified but have
a few issues however this branch is out of date with the refacted
master branch for unit tests. This commit gets the main change in
a future commit will update the tests.
2026-05-12 18:03:46 +10:00
rc-swag
bd1e404ae4
Merge branch 'master' into fix/windows/15857/caps-indicator-switched-off-select
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
2026-05-06 10:47:24 +10:00
rc-swag
28d2c98030 fix(windows): rename local variable no actions
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
2026-04-27 10:39:34 +10:00
rc-swag
874c2509b0 fix(windows): initialise action object in contructor
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
2026-04-24 10:40:45 +10:00
Marc Durdin
0f57b8a77c chore(core): Merge branch 'epic/embed-osk-in-kmx' into chore/core/remove-jsonpp
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
2026-04-17 09:12:37 +02:00
Marc Durdin
35e09caf64 chore(core): remove jsonpp
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
jsonpp was being used only in a single unit test, and so this was a lot
of overhead and complexity for very little benefit. We may want to add
some more unit tests in the future for state_api.tests.cpp to do a
deep comparison of the state?

Test-bot: skip
2026-04-11 07:39:56 +02:00
Eberhard Beilharz
382b5d45e3
fix(core): fix keydown/up handling for LDML keyboards
For LDML keyboards this change fixes the `emit_key` flag so that it has
the same value for the KeyDown and the KeyUp event. This fixes some
problems with stuck keys. Previously we would set `emit_key=TRUE` on
KeyDown but `emit_key=FALSE` on KeyUp for frame keys. This caused Linux
to never see the KeyUp event, resulting in a stuck key.

Also add unit tests that verifies that the actions that we get after
calling `km_core_process_event` are what we expect.

Fixes: #15569
Fixes: #15550
2026-03-02 17:27:36 +01:00
Marc Durdin
232df37400
chore: Update core/src/state.cpp 2024-02-07 12:29:45 +11:00
Marc Durdin
9ba919c2a9 fix(core): surrogate handling, markers in app context, and memory leak
Fixes #10615 (surrogate handling, km_core_state_context_set_if_needed).
Fixes #10616 (markers in app context, in unit tests)
Fixes #10617 (memory leak in replace_context).

The surrogate handling and markers in app context bugs were quite
tangled, so opted to fix those both together in one commit. The memory
leak was spotted while verifying the changes for surrogate handling.

Surrogates were not handled in is_context_unchanged, and opted to
refactor to work directly with km_core_context_item arrays rather than
continue with the string-based comparison, for simplicity.

While writing the corresponding unit tests, realised that the
app_context checks were incorrect in a number of existing tests, and so
fixed up the existing tests at the same time as writing up the new
tests. The only changes to core for this were to add assertions for the
app_context to ensure that markers are not inadvertently added.
2024-02-03 09:16:16 +07:00
Marc Durdin
0b7556870f
chore: Apply suggestions from code review 2024-02-01 18:56:26 +11:00
Marc Durdin
15f2412717 chore(core): build whackamole 2024-02-01 12:50:23 +07:00
Marc Durdin
1b88ab99be fix(core): make km_core_state_get_actions() idempotent
Fixes #10582.

Returned struct from the `km_core_state_get_actions()` API is now owned
by the state object. This is a change in API contract. The corresponding
`km_core_actions_dispose()` API has been made private, because there is
never any need for API consumers to call it. As this change is happening
in alpha, we won't bump the ABI version.

`state->app_context` is now guaranteed to be in sync with
`state->context` after `km_core_process_event()`, with the actions
struct populated at that point.

The next and final step in this refactor is to remove the actions queue
altogether from the Core and make that a kmn-only concept, but that will
wait until 18.0. The only consumers of the actions queue are the
kmn-specific interactive debugger in Keyman Developer, and kmn-specific
Input Method eXtensions in Keyman Engine for Windows.
2024-02-01 11:28:08 +07:00
Eberhard Beilharz
604fbc1a75
chore(linux): Rename namespace kbp to core 2023-10-19 10:39:55 +02:00
Marc Durdin
db76e2541d chore: rename KM_KBP_ to KM_CORE_ 2023-10-09 14:53:22 +07:00
Marc Durdin
ba5f18defd chore: rename km_kbp_ to km_core_ 2023-10-09 14:53:13 +07:00
Marc Durdin
906a0a2ed7 chore: fix typo 2023-10-09 14:41:01 +07:00
Marc Durdin
4ef18f5e29 chore(core): rename keyboardprocessor.h to keyman_core_api.h
Fixes #9721.

Also tweaks some documentation references to keyboardprocessor, but does
not touch those relating to debian/control.
2023-10-09 14:21:01 +07:00
Marc Durdin
a58680f89b chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
Renamed from common/core/desktop/src/state.cpp (Browse further)