Commit graph

2142 commits

Author SHA1 Message Date
Darcy Wong
55e893fd33 Merge pull request #5269 from keymanapp/chore/crowdin-es-419
chore(common): Check in crowdin strings for Spanish (Latin America)
2021-12-17 07:41:28 +07:00
Marc Durdin
627eb662c7
Merge pull request #5775 from keymanapp/fix/windows/cherry-pick/5091-default-language
fix(windows): handle edge cases using default language 🍒
2021-10-06 08:09:10 +11:00
Marc Durdin
2e75ed0270 chore: additional sentry.io links 2021-10-04 15:23:44 +11:00
Marc Durdin
35d1d2dde8 chore: sentry.io dsn 2021-10-04 15:23:31 +11:00
Marc Durdin
dac9e80c97 fix(windows): unit test os version 2021-09-30 06:23:15 +10:00
Marc Durdin
66ddceadda fix(windows): change canonicalization strategy for Windows 7
On Windows 7, we will no longer attempt to canonicalize BCP 47 tags in
the same was as on later OS versions, because there appear to be some
significant differences in how they work, for example, zh-CN is not
converted to zh-Hans-CN on Windows 7, whereas it is on Windows 10.

This commit also refreshes the `KLog` unit which is useful for debugging
these types of scenarios.
2021-09-29 17:30:35 +10:00
Marc Durdin
1aac15fec8 chore(windows): Apply suggestion
Co-authored-by: Darcy Wong <darcy_wong@sil.org>
2021-09-29 17:29:37 +10:00
Marc Durdin
98aa017318 fix(windows): handle edge cases using default language
Fixes #5091.

If the user has a default language that is not a minimal BCP47 tag, such
as `zh-Hans-CN` vs `zh-CN`, or if the default language does not have a
mapping in our `TLanguageCodeUtils.TranslateWindowsLanguagesToBCP47`
function, then kmshell would crash on install of a keyboard that had no
language metadata specified (i.e. neither legacy metadata in .kmx nor
modern metadata in .kmp).

This crash arose because the elevated instance of kmshell would install
a local-machine reference to `zh-CN` (as it back-translated from a
LangID), but the current user install would look for `zh-Hans-CN`, read
from the Windows registry `HKCU\Control Panel\International\User Profile`.

To further complicate matters, it is possible for the current user to
have a different default language than the elevated user on the machine.
Keyman was assuming that the default language was the same in both
cases.

This fix passes in the current user's default BCP47 and LangID to the
elevated portion of the keyboard install, so we can guarantee that
keyboard install which needs to use the default language, actually
installs for the current user's actual language code, and not a
canonicalized version (or a totally different code in the case of
elevation to an alternate admin user account).
2021-09-29 17:29:34 +10:00
Marc Durdin
063cee0a1d chore(windows): fix broken links in help 2021-09-29 07:19:45 +10:00
Marc Durdin
e7c6c5e19c
Merge pull request #5685 from keymanapp/fix/windows/cherry-pick/5683-keyboard-name-fallback
fix(windows): fallback to filename if `&name` not set 🍒
2021-09-17 10:12:18 +10:00
Marc Durdin
2079947319
Merge pull request #5679 from keymanapp/test/windows/4889-investigate-tip-crash
test(windows): investigate TIP crash
2021-09-14 18:50:56 +10:00
Marc Durdin
16d482b66c fix(windows): fallback to filename if &name not set
Fixes #5683.

If `store(&name)` is missing from a keyboard, then fallback to the
filename of the keyboard (sans extension). This fixes a regression in
14.0 keyboard registration.

I opted not to make this change in kmxfile but rather in places which
use it in the Keyman Engine COM API, because I wanted kmxfile to remain
truthful about all details of what it is reading from the file.

Given that the COM API will now never return an empty string for the
name of the keyboard, there are  mitigations for this in Keyman
Configuration which are unnecessary, but it is not harmful for them to
remain there.

Will cherry-pick to stable-14.0.
2021-09-14 08:27:36 +10:00
Marc Durdin
83f4a6b711 test(windows): investigate TIP crash
Relates to #4889.

Adds extra diagnostics to try and trace why we are getting a crash in
rare cases when installing a keyboard language.
2021-09-10 15:59:51 +10:00
Marc Durdin
1daa311802 fix(developer): ensure file modified after import from layout
Fixes #5577.

This ensures that the touch layout file is marked as modified after
running Import From Layout in Keyman Developer, so that changes are
not lost when you save.
2021-09-10 14:22:56 +10:00
Darcy Wong
6cb0b0af18 chore(ios,windows): Cherrypick 5486 2021-08-05 07:57:37 +07:00
Darcy Wong
6d925853d7 chore(windows): Add another round of Azerbaijani updates 2021-07-26 10:10:26 +07:00
Darcy Wong
5b9b4851a5 chore(windows): Update crowdin strings for Azerbaijani 2021-07-24 06:27:33 +07:00
Marc Durdin
24e1eeeab7 chore: update README 2021-06-28 06:47:35 +10:00
Marc Durdin
2509eec9f1 chore: keyboard_info.source.json 1.0.6 2021-06-28 06:35:59 +10:00
Marc Durdin
0f92e50ce8 fix(windows): osk scaling mismatch on horz axis
Font scaling on individual keys would ignore the vertical axis if the
horizontal axis reached the key width threshold, rather than calculating
the minimum of the two axes. This lead to weird effects, such as adding
characters to a key could make the font larger rather than smaller!

Reported by @jmdurdin.
2021-06-23 19:39:25 +10:00
Marc Durdin
3b7cc40839
Merge pull request #5222 from keymanapp/fix/windows/cherry-pick/keymanx64-controller-refactor
fix(windows): improve keymanx64 start stability 🍒
2021-06-22 15:15:03 +10:00
Marc Durdin
ab353265f0
Merge pull request #5299 from keymanapp/fix/developer/cherry-pick/kmconvert-help
fix(developer): kmconvert help match reality 🍒
2021-06-17 17:51:46 +10:00
Marc Durdin
f5a314b32a chore: correct example 2021-06-17 04:52:05 +10:00
Marc Durdin
f8a49bd0dc fix(developer): kmconvert help match reality
Cherry-pick from #5298.

kmconvert built-in help was missing `-targets`, and the parameter
checking was skipping the last parameter (which only mattered if the
last parameter was `-nologo`, but still...).
2021-06-17 04:46:35 +10:00
Darcy Wong
c27d971854 chore(common): Add YouTube links to Keyman 14 features 2021-06-15 07:27:27 +07:00
Marc Durdin
c9f82b7599 chore: tweak record order 2021-06-11 12:47:14 +10:00
Marc Durdin
3827355741 fix(windows): disable new hotkey modifier check
Disables the new modifier check added in #5189.
2021-06-11 12:24:54 +10:00
Marc Durdin
b199b574e5 chore(windows): fixup unused parameters 2021-06-10 15:17:33 +10:00
Marc Durdin
947b50cfa1 chore(windows): Keyman_PostControllers returns void 2021-06-10 12:27:47 +10:00
Marc Durdin
62a5e3dee7 chore(windows): def declaration order 2021-06-10 11:21:47 +10:00
Marc Durdin
332caa5188 fix(windows): restore endpoints for interface stability
Fixes #5245.

Interfaces should remain stable between versions of Keyman, so that an
upgraded kmcomapi.dll or keyman32.dll will not crash older clients, even
if they may not behave entirely as expected.
2021-06-10 11:17:04 +10:00
Marc Durdin
9e9bf06bc1 fix(windows): start keymanx64 with ShellExecute
Fixes #5196.

It is complicated to start a `UIAccess=true` process with
`CreateProcess`, so instead we'll use `ShellExecute`. This means passing
a PID instead of a process handle to keymanx64.

I took the opportunity to refactor slightly the main function in
keymanx64, as the failure modes were pretty WET.
2021-06-04 06:52:14 +10:00
Marc Durdin
4a94825067 chore(windows): remove unused keymanx64 parameter
With the recent refactor in #5060, we no longer need the main form
window handle parameter in keymanx64.
2021-06-04 06:52:04 +10:00
Marc Durdin
a1911e637d chore: add missing file 2021-06-04 06:51:54 +10:00
Marc Durdin
f0e3337a4b chore(windows): remove KMC_CHANGEUISTATE
The `KMC_CHANGEUISTATE` flag for `wm_keyman_control` is no longer
processed anywhere. Removes it and the `UpdateKeymanUI` function which
called it.

The `#define` for the flag has been left, commented out, to clarify what
would otherwise be a gap in identifiers (use `git blame` to learn more).
2021-06-04 06:51:47 +10:00
Marc Durdin
886e96e1be fix(windows): refactor controller windows
Fixes #5004.

This cleans up the use of controller windows. A single window is now
given the responsibility of being the master controller, which receives
messages from Keyman32 and other components around UI activation, active
keyboard, etc.

The master controller is keyman.exe's `TApplication` window, which does
not get destroyed and recreated, unlike the main form window.

Any thread which has responsibility for Keyman UI (keyman.exe main
thread, keymanx64.exe main thread) is also registered as a controller
thread. A controller thread has special handling for interactions with
keyman32 around focus tracking.

Caveats:

* While keymanx64 does not have a visible window and thus probably does
  not need to be registered as a controller thread, it doesn't really
  hurt.
* Note that keymanx64 registers the 32-bit controller thread as well,
  which again is probably unnecessary as the 64-bit process cannot
  interact with the 32-bit thread.
* Keyman's main form still handles wm_keyman_control messages, as there
  are a number of other components which post to that window (e.g. text
  editor, com library visual keyboard interactions). Unlike the original
  problem trigger, the reference handle is not stored long-term and so
  there is unlikely to be a problem with main form window re-creation
  causing an issue in these contexts.

There are several TODO items in this which I will address in follow-ups,
to reduce the scope of these changes.

I hope to cherry-pick this to stable-14.0, but will run for a while in
15.0 before doing so.
2021-06-04 06:51:35 +10:00
Marc Durdin
ec02119049 chore: remove extra file 2021-06-04 06:50:49 +10:00
Marc Durdin
de34944b0e chore: address review comments 2021-06-04 06:50:48 +10:00
Marc Durdin
c9248ca7ec chore: address review comment 2021-06-04 06:50:47 +10:00
Marc Durdin
53b37d44f0 fix(windows): make keymanx64 responsible for its own lifecycle
Fixes #4976.
Fixes KEYMAN-WINDOWS-2K.
Fixes KEYMAN-WINDOWS-3F.
Fixes KEYMAN-WINDOWS-5A.
Fixes KEYMAN-WINDOWS-3E.

This fix reworks keymanx64's lifecycle, moving responsibility for
process shutdown from keyman.exe to keymanx64.exe.

This eliminates the need for interprocess communication, and simplifies
the startup and shutdown of keymanx64.exe. Removing this means that we
can more safely handle situations where two instances of keymanx64 may
be started, as one of them will rapidly terminate when it discovers that
its parent process has disappeared.
2021-06-04 06:50:47 +10:00
Marc Durdin
617330d8e1 chore(windows): review comments
Co-authored-by: rc-swag <58423624+rc-swag@users.noreply.github.com>
2021-06-04 06:49:52 +10:00
Marc Durdin
ea5417eefc fix(windows): handle errors starting keymanx64
Fixes #4988.
Fixes KEYMAN-WINDOWS-3F.

This relates to #4976 and is a stop-gap until we implement that. It will
reduce the number of reported errors (both to us and the end user) but
does not address the core issue, which requires a more significant
refactor.
2021-06-04 06:49:51 +10:00
Marc Durdin
28ad0af134 fix(developer): support spaces in regression tests
Fixes #5216.

A `<text>` element in the regression text xml which contained only
whitespace would cause the import to crash as this would be ignored by
the XML parser, leading to a `Null` `nodeValue` for that element. To
solve this, we need to:

1. Use `xml:space="preserve"` attribute on `<text>` elements
2. Update the DTD to allow `xml:space` on `<text>` elements
3. While we are at it, move the DTD from `www.tavultesoft.com` to
   `api.keyman.com`.

See also:
* keymanapp/tavultesoft.com#4
* keymanapp/api.keyman.com#155
2021-06-03 10:07:31 +10:00
Marc Durdin
537fc594c3
fix(windows): cleanup edge cases in k32_load
Matches work completed in #5169 for Keyman Core, kmx_file.cpp.

While this code will hopefully disappear in 15.0, it's good to make sure
we aren't diverging beforehand.

Also tidies up a couple of other cases in `CopyKeyboard` in Keyman Core.

(cherry picked from commit c9897bb38f)
2021-05-31 15:00:27 +02:00
Marc Durdin
8f04ad9954
Update windows/src/global/delphi/general/Keyman.System.Settings.pas 2021-05-31 11:28:45 +10:00
Marc Durdin
7ffd273184 fix(windows): swap default for flag 2021-05-29 16:15:30 +10:00
Marc Durdin
3d21507193 fix(windows): avoid cached hotkey state 2021-05-29 15:42:10 +10:00
Marc Durdin
13d266f0ea
Merge pull request #5097 from keymanapp/fix/developer/cherry-pick/5095-editor-settext-not-synchronous
fix(developer): TframeTextEditor.SetText was not synchronous 🍒
2021-05-21 08:31:44 +10:00
Darcy Wong
f9db2e5efe chore(common): Check in crowdin strings for Amharic 2021-05-20 05:47:59 +07:00
Marc Durdin
52dcd313bf fix(developer): TframeTextEditor.SetText was not synchronous
Fixes #5095.

If the text editor was loaded, `SetText` would not be synchronous
because it executed some Javascript to make the text change, so setting
the text and immediately reading it again would give the old text. This
is what the On Screen Keyboard editor was doing (it would synchronize
the visual editor and text editor at save). This fix updates `SetText`
to update the backing store as well as the front end editor.
2021-05-18 06:33:33 +10:00