Commit graph

16 commits

Author SHA1 Message Date
Marc Durdin
cda2272ccb 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:19:29 +10:00
Marc Durdin
fbcfd62678 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-05-11 14:47:17 +10:00
Marc Durdin
3a59175465 fix(windows): avoid error if keyman32.dll renamed
Fixes #4939.
Fixes KEYMAN-WINDOWS-70.
Fixes KEYMAN-WINDOWS-71.
Fixes KEYMAN-WINDOWS-BR.
Fixes KEYMAN-WINDOWS-6J.

I am speculating a little here, because the root cause is not visible in
the crash report, but it appears that if keyman32.dll is renamed, that
the UnregisterControllerWindows function attempts to reload keyman32.dll
which means that (a) it no longer has a list of registered controllers,
and (b) it may fail to reload.

Instead of throwing an exception, we now only log this error in
development mode. The error is not likely to cause significant trouble
for end users as they are shutting down Keyman anyway at this point.

The resolution if there is any uncertainty during an upgrade is to
restart Windows. This is less than ideal but avoids file locks and
problems with in-memory DLLs. (Future versions of Keyman will schedule
upgrades to happen automatically after a restart before Keyman has been
started, in an effort to avoid this kind of trauma.)
2021-04-21 14:21:17 +10:00
Marc Durdin
e664e93de7 fix(windows): Improve refresh reliablilty
This change has three fixes to improve the reliability of notifying
Keyman Engine of updates to settings or keyboard installs:

1. It removes the closure pattern of the refresh thread, because that
   was closing on a variable on a different thread (`RefreshHandle`) and
   that could cause races and/or exceptions in the case of early free.
   What's more, the closure was actually unnecessary as the variable was
   really only used by the refresh thread!

2. It moves responsibility for setting the refresh token to the calling
   thread so that the caller can depend on the token being the one that
   is actually sent, removing a race.

3. Most important, the refresh thread now flushes all messages in its
   queue, as there may be multiple messages relating to the window
   construction that need to be processed before the wm_keyman_refresh
   message can be handled. This greatly improves the chance of the
   notification actually being sent!
2020-12-18 08:06:03 +11:00
Marc Durdin
17b444bff2 fix(windows): Settings refresh management
Fixes #4011.
Fixes #4039.
Fixes #4121.

This change completes the immediate-change model for Keyman
Configuration, by refactoring the refresh of settings out of the render
phase and more appropriately splitting applying and refreshing. It adds
a new message flag for wm_keyman_refresh, KR_SETTINGS_CHANGED, which
uses a random token approach broadcast to all applications on the
desktop to ensure that the refresh is received and multiple
notifications for the same event can be appropriately coalesced.

Most of the files touched are stripping out the refresh flags from the
render phase.

There is one small bug resolved at the same time with the options
properties, which were not reset to default if they had been deleted
from the registry prior to a refresh (see utilkeymanoption.pas).
2020-12-17 10:50:21 +11:00
Marc Durdin
11a2cf53c5 fix(windows): Keyman Configuration changes apply instantly
Fixes #3518.

Changes in Keyman Configuration will now apply immediately. This removes
the OK and Cancel buttons from the dialog and means that all actions
are consistent in when they are applied, unlike previously. This also
matches the Windows 10 Settings metaphor and metaphors for most modern
apps and devices.

For now, I have placed a message where the OK and Buttons were
previously, to help existing users understand the change. In time, I
expect us to be able to remove that message entirely.
2020-10-26 15:18:04 +11:00
Keyman Server
97a16e8535 feat(windows): profile installation - engine 2020-08-26 11:06:10 +10:00
Marc Durdin
fed63d4690 feat(windows): sentry integration test points 2020-03-31 16:16:56 +11:00
Marc Durdin
1ebe2f5fa1 fix(windows): Windows touch keyboard would cancel on each keystroke
Fixes #2450. When Keyman serialized input, it would cause the touch keyboard to cancel
because the touch keyboard thought the received event meant the user was touching the
physical keyboard. This resolves that problem, using a watch timer to check the visibility
of the touch input panel.
2020-02-04 16:18:18 +11:00
Marc Durdin
7e2c21b8a7 [Windows] Refactor serialized input to use a low level keyboard hook to avoid conflicts 2018-10-03 15:22:38 +10:00
Marc Durdin
cdeb36977a Fixes IKeymanControl::OpenConfiguration giving noop 2018-06-18 14:24:44 +07:00
Marc Durdin
45b2eff995 Fix destruction order error in Win32 implementation 2018-01-03 07:44:20 +11:00
Marc Durdin
736ab49ece Fix bugs in x64 implementation of kmcomapi incl workaround for #508 2018-01-01 17:26:53 +11:00
Marc Durdin
2306169d31 Rework build for x64 msbuild support and add 64-bit support to keymancontrol 2017-12-30 07:37:30 +11:00
Marc Durdin
9b026c423e x64 support for COM API - first steps: build of kmcomapi.dll for x64, and rename of registry keys 2017-12-24 13:47:56 +07:00
Marc Durdin
b65b982584 Keyman Desktop and Keyman Developer open source 10.0 alpha seed (#121)
* Keyman for Windows 10.0 Open Source

* Squashed 'windows/src/ext/jedi/jedi/' content from commit f444ad2

git-subtree-dir: windows/src/ext/jedi/jedi
git-subtree-split: f444ad2da4693851e523f1ea6bd541f701904c24

* Squashed 'windows/src/ext/jedi/jcl/' content from commit d63d3c9fd

git-subtree-dir: windows/src/ext/jedi/jcl
git-subtree-split: d63d3c9fd9ff84efdd8159084ec6a60313644243

* Squashed 'windows/src/ext/jedi/jvcl/' content from commit bee19f3b4

git-subtree-dir: windows/src/ext/jedi/jvcl
git-subtree-split: bee19f3b46909fde2fa92c06cd2706f41d99f6c3

* Add required .res files

* Add required .res files

* Add docbook files (forced)

* Add required libxslt

* Add required jedi files

* Add installation files

* Tweak .gitignore for open

* CI

* Remove KMW from Developer source (#122)

* Remove KMW from Developer source (copies during build)

* Remove KMW from Developer source (copies during build)

* Remove KMW from Developer source (copies during build)

* Fixup release build and copy license, readme from kmw during build

* Remove obsolete build help documentation

* Keyman Engine 10 on Windows regression for shift states (#129)

* Improve #128 -- cleaner debug messages

* Fixes #127, shift state now resets correctly; and more work for #128

* Fixes #130 (#131)
2017-07-25 10:53:06 +07:00