Commit graph

3486 commits

Author SHA1 Message Date
Marc Durdin
7235bf2057 fix(windows): sentry.dll version handling
Fixes #5166.

This introduces versioned management of sentry.dll for Keyman for
Windows, Keyman Engine and Keyman Developer. As sentry.dll's ABI is not
backwardly compatible, we have to maintain independent copies of each
DLL for each app.

sentry.dll (or sentry.x64.dll for x64 apps) will be found in the
sentry-0.4.9 folder relative to the running process, except when running
from within the keyman repo tree (based on presence of KEYMAN_ROOT env
var). In those cases, the windows/src/ext/sentry sentry.dll will be
used, allowing us to test new debug time sentry DLLs easily.

A little bit of cleanup and consolidation was also done in the
KeymanPaths.pas unit.
2021-05-28 15:55:06 +10:00
Marc Durdin
5fac633fb6 fix(common): build script help param
When working on a new build script, I tripped over the `-?` question
mark help parameter here, as it needs to be escaped. Opted to fix all
the instances in our scripts, although AFAICT there would not have been
current bugs arising from this, as there were no conflicting one
character options lower in the case list.
2021-05-28 09:50:40 +10:00
jahorton
8f1e1dc65a feat(common): offline help css 2021-05-26 15:40:45 +07:00
Marc Durdin
5b7dfa006b
Merge pull request #5144 from keymanapp/chore/windows/4607-sentry-update
chore(windows): Update Sentry to 0.4.9
2021-05-26 12:05:31 +10:00
Marc Durdin
e46a3ee46c
Merge pull request #5143 from keymanapp/chore/windows/vs2019
chore(windows): move to vc++ 2019
2021-05-25 19:38:32 +10:00
Marc Durdin
7c087ef6ac chore(windows): Update Sentry to 0.4.9
Fixes #4607.

The Sentry 0.4.9 update actually simplifies some things. It does only
build with VS2019 by default, which pushed me to update Keyman build to
the same version, but that's a good thing overall, and was fairly
painless anyway.

Previously, we had our own custom build of sentry-native to make sure
that the C++ runtime libraries were statically linked to sentry.dll, but
this is now configurable in the build options, so we were able to
abandon our fork of the project at
https://github.com/keymanapp/sentry-native, which is good news. (I will
leave the fork there just in case but we'll eventually delete it once we
are convinced that this is robust.)

I have updated sentry.pas to match sentry.h; most of the changes are in
comments but there are a handful of new functions and some small changes
to function signatures.

I retested the Sentry exception scenarios and results can be found at
https://docs.google.com/spreadsheets/d/19xfurbn4cGubSCD68EGuKhcR5HrjaUcY/edit#gid=170604584

There may be an issue with Delphi x64 programs missing symbols from my
machine; something to keep an eye on but not a blocker for this merging,
I think.
2021-05-25 18:34:38 +10:00
Marc Durdin
17518ca2ee chore(windows): update headers for mcompile 2021-05-25 18:33:46 +10:00
rc-swag
0fd5f01187
Merge pull request #5119 from keymanapp/docs/windows/5118-windows-keyman-engine-readme
docs(windows): Initial commit - README.md
2021-05-25 16:45:50 +10:00
Marc Durdin
f3ba9445dd chore(windows): update vcxproj for vc++2019 2021-05-25 15:58:48 +10:00
Marc Durdin
39cb018042 chore(windows): move to vc++ 2019 2021-05-25 15:56:36 +10:00
rc-swag
98d802f769
docs(windows): Apply suggestions from code review
Co-authored-by: Marc Durdin <marc@durdin.net>
2021-05-25 08:08:13 +10:00
Marc Durdin
45178152d0 chore(windows): update compiler option for consts
We still use -$J+ for our Delphi compiles but this was
buried in a .cfg which is deprecated. Moving this flag to Defines.mak
2021-05-24 15:54:14 +10:00
Ross Cruickshank
b2f3f5d5db docs(windows): add missing markdown "#" 2021-05-24 10:43:49 +10:00
Ross Cruickshank
4bbd242161 docs(windows): adding README.md to windows/src
Fixes #5118
2021-05-24 10:32:06 +10:00
Marc Durdin
8e435f67d1 chore(windows): cleanup old .dof, .bdsproj and .cfg files
Fixes #519.

I have removed these .cfg, .dof, and .bdsproj files from the primary
projects in the Windows source. There is some ambiguity as to whether
.cfg files are used by the command line compiler (I checked with procmon
and they *are* read by dcc32.exe), so we will need to make sure that
no adverse changes have been made by this. In theory at least, the
.dproj data trumps .cfg data -- and all the projects in question have
a .dproj file -- so this should be a safe cleanup.

I have opted not to touch the /buildutils, /ext, /support and
/test folders at this point.
2021-05-24 10:22:28 +10:00
Marc Durdin
cb8c77daaf chore: cleanup 2021-05-21 15:26:03 +10:00
Marc Durdin
d8af055626 chore(windows): adjust CEF interfaces 2021-05-21 15:21:31 +10:00
Marc Durdin
9e53505be0 chore(windows): cef4delphi source units 2021-05-21 15:20:58 +10:00
Marc Durdin
9f8a191a3e chore(windows): fetch origin before checkout 2021-05-21 14:59:48 +10:00
Marc Durdin
56fdc98a81 chore(windows): Chromium 89.0.18
Updates Chromium Embedded Framework to 89.0.18. Goes with
branch v89.0.18 of https://github.com/keymanapp/CEF4Delphi_Binary

Adds a script to checkout the correct version of CEF from the repo
according to CEF_VERSION.md.
2021-05-21 14:47:18 +10:00
Marc Durdin
998ac33c85
Merge pull request #5096 from keymanapp/fix/developer/5095-editor-settext-not-synchronous
fix(developer): TframeTextEditor.SetText was not synchronous
2021-05-21 08:31:40 +10:00
Marc Durdin
f86b8b499f
Merge pull request #5085 from keymanapp/feat/developer/4807-full-copyright-field
feat(developer): Add 'full copyright' field to templates
2021-05-21 08:31:28 +10:00
Marc Durdin
af1a4e7f66
Merge pull request #5084 from keymanapp/chore/windows/reorganise-tests
chore(windows): reorganise tests
2021-05-21 06:30:58 +10:00
Ross Cruickshank
f98cef1573 docs(windows): Update windows/engine/readme 2021-05-20 15:37:20 +10:00
Ross Cruickshank
5be6825721 docs(windows): Initial commit - README.md 2021-05-20 13:43:44 +10:00
Darcy Wong
f31edd8b52 chore(common): Check in crowdin strings for Amharic 2021-05-19 09:12:39 +07:00
Marc Durdin
9ecbf9bf60 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:30:22 +10:00
Marc Durdin
17e8780e8e feat(developer): Add 'full copyright' field to templates
Fixes #4807.

We want to differentiate between a short copyright message and a
longer one that also contains a date. The long one is only needed in
one place in a typical keyboard project. This reduces maintenance when
making keyboard updates.
2021-05-14 16:35:44 +10:00
Marc Durdin
756e2ece13 chore: fixup paths for tests 2021-05-14 14:32:29 +10:00
Marc Durdin
8c1b034a7b chore: reorganise tests 2021-05-14 13:35:02 +10:00
Marc Durdin
c8d6e4fe6f fix(developer): kmconvert commandline and deploy
A few fixes and improvements:
* kmconvert was missing a command line parameter for `-target` to
  specify the platform targets for a project
* kmconvert should avoid throwing unhandled exceptions, rather if
  sentry is not present then just write to console.
* Include kmconvert and its data files in the deployment of kmcomp.zip,
  which is done on the build agent (just need to make sure files are
  in the right place here.)
* Side fix: also made sure kmcomp would emit the exception message to
  console if sentry is not present.
2021-05-14 10:56:58 +10:00
Marc Durdin
c078661a0f 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-05-11 16:03:19 +10:00
Marc Durdin
9c01777ece chore: add missing file 2021-05-11 15:51:20 +10:00
Marc Durdin
d26b01ad99 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-05-11 15:19:01 +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
af67d180af
Merge pull request #5031 from keymanapp/fix/developer/kmdecomp-two-issues
fix(developer): two small issues in kmdecomp
2021-05-11 11:55:15 +10:00
Marc Durdin
b3087823a4
Merge pull request #5056 from keymanapp/chore/windows/remove-utilrun
chore(windows): remove unused utilrun unit
2021-05-11 11:54:28 +10:00
Marc Durdin
ed3e9caa4e chore(windows): FixupMissingFile needed current component code
UFixupMissingFile referred to an old MSI component code, which meant
that it would never actually fix the installation. This now refers to a
current component code.

I may backport this to stable-14.0 but would like to assess its
stability over time first.
2021-05-11 08:39:33 +10:00
Marc Durdin
cfea41382c chore(windows): remove unused utilrun unit 2021-05-11 08:38:07 +10:00
Marc Durdin
a6a658e8bc
Merge pull request #5002 from keymanapp/fix/windows/4976-redesign-keymanx64-lifecycle
fix(windows): make keymanx64 responsible for its own lifecycle
2021-05-10 19:46:12 +10:00
Marc Durdin
39f8a8ef6f
Merge pull request #5007 from keymanapp/chore/windows/4700-get-detail-on-cefmanager-error
chore(windows): add telemetry to trace crash on exit
2021-05-10 19:35:18 +10:00
Marc Durdin
b06c8edaac
Merge pull request #5000 from keymanapp/fix/windows/4965-alternative-tips-block-activation
fix(windows): avoid disabling Keyman when speech recognition starts
2021-05-10 19:34:59 +10:00
Marc Durdin
23505d8e7b chore: remove extra file 2021-05-07 17:19:43 +10:00
Marc Durdin
a23266a6b9 chore: address review comments 2021-05-07 17:17:48 +10:00
Marc Durdin
492394c4f6 chore: address review comment 2021-05-07 17:08:11 +10:00
Marc Durdin
72b8e42732 fix(developer): two small issues in kmdecomp
1. build paths when loaded as part of solution were incorrect
2. decompiling `if` statements did not work for `!=`
2021-05-05 09:52:06 +10:00
Marc Durdin
0908df873f chore(windows): add telemetry to trace crash on exit
Relates to #4700.

This simply adds some debug logging so that when the current crash
occurs, we can discover which windows have failed to automatically
close, which should give us enough detail to be able to reproduce the
problem, hopefully, and fix it.
2021-05-02 14:44:55 +10:00
Marc Durdin
ee6f8590a6 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-04-30 15:02:18 +10:00
Darcy Wong
18a36c2de3 fix(windows): Fix more whitespace 2021-04-30 09:50:10 +07:00
Marc Durdin
097ce9ac9a fix(windows): avoid disabling Keyman when speech recognition starts
Fixes #4965.

When speech recognition is enabled, it sometimes activates after a
Keyman keyboard is selected. This would cause Keyman to think it is
being deactivated. We needed to check in
`CKMTipTextService::OnActivated` that it was a keyboard-type TIP that
was being activated, and only deactivate the Keyman hooks in that
situation.

This commit also adds a little logging helper function, and removes an
unused variable `guidActiveProfile`.
2021-04-30 09:04:12 +10:00