This change improves the stability of Keyman for Windows by monitoring
the health of the low level keyboard hook. If keyman.exe is unresponsive
at any time, Windows can silently uninstall its low level keyboard hook,
which results in (at least) two problems:
* Keyman's hotkeys stop working
* A modifier key can become stuck, if it was pressed around the time
Keyman became unresponsive.
The most common scenario in which Keyman can become unresponsive is high
system load, e.g. rendering graphics, videoconference calls, compiling
software.
Restarting Keyman always resolved both of these two issues in the past,
but with this patch, I hope that this will no longer be necessary.
A related 'fakefreeze' project is not included in this cherry-pick; see
PR #15179 for this.
Logging has been updated; look for "LowLevelHookWatchDog" in the log for
related events.
One final small change in keyman32.cpp, as I refactored the
WH_KEYBOARD_LL hook installation/uninstallation, was to always clear out
hook variables when uninstalling a hook, because if the hook fails to
uninstall, there's really nothing we can do about it anyway, and we
probably shouldn't be trying again.
Fixes: #8064
Cherry-pick-of: #15179
Test-bot: skip
Build-bot: skip
Fixes: #14342
The Windows system level keyboard hotkeys controlled in
registry have sometimes been incorrectly written as
a DWORD datatype. There 106 events in sentry for just
July. When opening the Windows setting dialog and the registry
has DWORDS it will show unassinged in the dialog if apply
is pressed it will convert the keys to REG_SZ.
This fix follows a similar pattern it will check the data
type of the registry key if it is DWORD it will remove it
and add a new key of the same name as REG_SZ and set it to
the unassigned value.
Fixes: KEYMAN-WINDOWS-4NK
Adds breadcrumbs for debug memo to try and narrow down sequence of
events leading to assertion failure with backspace.
Relates-to: #11706
Test-bot: skip
Cherry-pick-of: #15056
While not documented as such, it appears that the repository record is
required with trusted publishing of npm packages.
Cherry-pick-of: #15049
Build-bot: skip release:developer
I am not entirely clear why the coverage dropped, but I suspect it's due
to code paths that are not activated in node 24. For now, just dropping
coverage threshold to 40%.
Cherry-pick-of: #15042
If the repository is a shallow checkout, then the only commit will be
the most recent one, and the test will fail. We could lookup the date of
the most recent test, but it's a pretty meaningless test, so instead we
will skip the test in this scenario.
For example, this happens on GitHub Actions when we do a shallow
checkout. The only risk we have is if we move all builds to shallow
checkouts and end up always skipping this test, but (a) the code is
unlikely to change, and (b) issuse would be picked up on local builds
in that situation pretty quickly.
Cherry-pick-of: #15042
Due to recent changes in NPM package publishing security requirements,
we have to move from TeamCity build to a GitHub Action to publish our
NPM packages, so we can take advantage of trusted publishing. This
change also consolidates and centralizes the npm publishing into
resources/build/ci/npm-publish.sh, which removes a lot of boilerplate
from each of the build.sh scripts, and ensures consistency.
Packages will be `npm pack`ed on PR and test builds, and published in
release builds.
Ref: https://docs.npmjs.com/trusted-publishers
Ref: https://github.blog/changelog/2025-09-29-strengthening-npm-security-important-changes-to-authentication-and-token-management/Fixes: #14963
Test-bot: skip
Build-bot: release:developer
Cherry-pick-of: #15029
The typeFlags property is used to differentiate Unicode and non-Unicode
keys in the array of keys in a .kvk file. All non-Unicode keys should
be ignored, as we do not support non-Unicode keyboards on macOS.
The reason this fixes#15007, is that the keyboard in question had both
ANSI and Unicode sections in its .kvk file, and the ANSI section was
stored after the Unicode section, so the font spec for ANSI was
overriding the previously (correctly) set Unicode font spec.
Fixes: #15007
Cherry-pick-of: #15008
Test-bot: skip
This probably arose with the move to kmcmplib in WASM, and as it was
never unit tested, we missed it. A simple signed vs unsigned issue.
Fixes: #14411
Test-bot: skip
Cherry-pick-of: #15002
Adjust two incorrect rules that caused backslash to be treated as an
escape in strings in syntax highlighting in .kmn language.
Fixes: #14988
Test-bot: skip
Build-bot: skip
Cherry-pick-of: #15001
fix(linux): use `ibus` command to restart ibus 🍒🏠
When using Kubuntu exiting ibus sometimes used to hang (#10178). This was because ibus' `bus.exit()` doesn't shutdown properly (see https://github.com/ibus/ibus/issues/2816#issuecomment-3410473708). The recommended way is to use the `ibus exit` command. Since we no longer use the API we can directly use the `ibus restart` command, which this PR implements.
Fixes: #10178
Cherry-pick-of: #14971
When using Kubuntu exiting ibus sometimes used to hang (#10178). This
was because ibus' `bus.exit()` doesn't shutdown properly
(see https://github.com/ibus/ibus/issues/2816#issuecomment-3410473708).
The recommended way is to use the `ibus exit` command. Since we no longer
use the API we can directly use the `ibus restart` command, which this
PR implements.
Fixes: #10178
Cherry-pick-of: #14971
fix(linux): replace `dbus-x11` dependency 🍒🏠
When using a different DBus implementation `dbus-launch` might not exist, but instantiating a `SessionBus` object might start a session dbus if it's not already running. This change also replaces the `dbus-x11` dependency with `default-dbus-session-bus | dbus-session-bus` and changes the way we detect if dbus is already running.
Also remove `DBUS_SESSION_BUS_ADDRESS` from `sudo gsettings` call. It turns out we don't need this since we execute the `gsettings` command in the context of the user anyway which connects to the user's session dbus.
Cherry-pick-of: #14895Fixes: #14888