Commit graph

3486 commits

Author SHA1 Message Date
Marc Durdin
6cbf8de840
Merge pull request #4406 from keymanapp/fix/windows/4393-crash-deleting-wordlist
fix(windows): crash deleting wordlist
2021-02-03 16:52:03 +11:00
Marc Durdin
12834c618a
Merge pull request #4405 from keymanapp/chore/windows/case-sensitive-tests
chore(windows): tests should be case-sensitive
2021-02-03 16:51:50 +11:00
Marc Durdin
0c782e22d3 fix(developer): Compiler check for if and nul at start of context
Fixes #4280.

Adds checks to verify that `if()`, `platform()`, `baselayout()` and
`nul` are at the start of the context in the appropriate order.

Adds unit tests to validate these checks.

These are conditions that have been present in earlier versions of
Keyman but not enforced until now. Keyboards that do not meet these
conditions would not work correctly in all circumstances and should be
updated to meet the requirements.

An alternative would have been to reorder the context string but that is
much more complex as manipulation would also have been required for the
output string. The enforced order is logical and reduces confusion in
any case.

Updated documentation coming along shortly.
2021-02-03 15:28:53 +11:00
Marc Durdin
171b6fac54 fix(developer): debug information with unicode identifiers
Fixes #4250.

This implements @jahorton's suggestion of including the original name
in a comment alongside the munged name, as well as appending the unique
integer identifier of each symbol.

Note: the error reporting code needed a massage to support Unicode error
strings; in the future we should update the C++ compiler to emit
Unicode error strings also.
2021-02-03 10:54:20 +11:00
Marc Durdin
953cb15581 fix(windows): Use forward slashes in wordlist paths
Fixes #3336.
2021-02-03 10:15:30 +11:00
Marc Durdin
8f1fc61cc6 fix(windows): crash deleting wordlist
Fixes #4393.
Fixes KEYMAN-DEVELOPER-46.
Fixes KEYMAN-DEVELOPER-45.

This arose because deleting a tab caused Delphi VCL to switch to another
tab in the page control, which is IMHO a bug in the TPageControl VCL
component. Furthermore, when the active page is changed under these
circumstances, the normal OnChange and OnChanging events are not fired,
which means that the Source tab (which is the lucky tab to be activated)
never gets initialised. This cascades eventually to a crash due to the
Source tab's text editor not being properly loaded.

Two parts to this fix:

1. Restore the active page when we delete a wordlist tab (RSP-32327);
   this does not resolve the crash but does avoid weird side-effect of
   the active tab changing.
2. Initialise the source tab when we load the form so that the
   initialisation issue described above is avoided.

A separate fix in modelTsProjectFile avoids a (handled) null variant
conversion exception.
2021-02-03 09:43:48 +11:00
Marc Durdin
01645ff8c5
Merge pull request #4400 from keymanapp/fix/developer/2657-import-support-targets
fix(developer): Import Keyboard support for Targets
2021-02-03 07:08:45 +11:00
Marc Durdin
4a1ee301f1
Merge pull request #4399 from keymanapp/fix/developer/2679-template-for-web-not-touch
fix(developer): Generate platforms correctly from template
2021-02-03 07:08:25 +11:00
Marc Durdin
d603c77cd7
Merge pull request #4386 from keymanapp/fix/windows/4192-show-balloon-when-keyman-is-already-running
fix(windows): Show balloon when Keyman is already running
2021-02-03 07:08:00 +11:00
Marc Durdin
aebdec42bf
Merge pull request #4398 from keymanapp/fix/developer/4354-setup-redist-check
fix(developer): don't check both setup.exe and setup-redist.exe
2021-02-03 07:07:37 +11:00
Marc Durdin
e123b1a667
Merge pull request #4392 from keymanapp/fix/windows/setup-should-ignore-cert-revocation
fix(windows): setup should ignore cert revocation
2021-02-03 07:07:16 +11:00
Marc Durdin
d8df94c2e0
Merge pull request #4384 from keymanapp/fix/windows/3936-uac-foreground
fix(windows): Ensure UAC window comes to foreground
2021-02-03 07:06:14 +11:00
Marc Durdin
83b8c4af08 chore(windows): tests should be case-sensitive
DUnitX by default does case-insensitive string equality assertions, and
we don't really want to make that assumption.

There was one minor fail uncovered in Keyman.System.UILanguageManager as
a result of this -- it now returns a matching entry as found in the
list of UI languages, rather than the input, to get same case as the UI
language list entry.

Thank you @ermshiperete.
2021-02-03 06:52:52 +11:00
Marc Durdin
adafdb9c84 fix(developer): Import Keyboard support for Targets
Fixes #2657.

Importing a Windows Keyboard had an option to select default targets for
the imported keyboard, but the option was ignored. This propagates the
option setting through the import process.
2021-02-02 16:12:45 +11:00
Marc Durdin
5208404cd6 fix(developer): Generate platforms correctly from template
Fixes #2679.

If web is specified but not a touch platform, exclude touch layout from
a generated project. Also, fixup list of supported platforms in the
generated README.md.
2021-02-02 15:50:56 +11:00
Marc Durdin
d311886a7e fix(developer): don't check both setup.exe and setup-redist.exe
Fixes #4354.

The redistributable build should be checking for the existence of either
setup.exe or setup-redist.exe. Note that the only difference between the
two is whether or not the file has a digital signature (as we should not
put a digital signature on an executable that will later have a .zip
appended, rather the final file should be signed).
2021-02-02 15:32:14 +11:00
Marc Durdin
3850087109 fix(windows): rename RefreshTag_Process variable
`RefreshTag_Process` should be named `RefreshTag_Thread`.
2021-02-02 14:58:59 +11:00
Marc Durdin
ca7ab8a7d8 fix(windows): improve cross-process refresh
Two changes here:

1. Only post the refresh message to the master controller, so that we
   get a single refresh regardless of how many controllers are
   registered.

2. When Keyman is restarted, the global RefreshTag is reset to 0, so we
   need to do a `!=` comparison rather than a `<` comparison to ensure
   that apps with an existing keyman32.dll/keyman64.dll in memory get
   refresh notifications (as their local `RefreshTag_Process` will
   likely already be greater than `0`).

Also a small additional debug statement.
2021-02-02 14:55:02 +11:00
Marc Durdin
7a16b07465
Merge pull request #4381 from keymanapp/fix/windows/4343-avoid-invalid-custom-languages
fix(windows): avoid invalid language codes in Add Language dialog
2021-02-02 08:41:35 +11:00
Marc Durdin
d81ff153b7
Merge pull request #4379 from keymanapp/fix/windows/4336-hotkey-show-keyboard-usage-plus-strings
fix(windows): remove Show Keyboard Usage hotkey
2021-02-02 08:41:28 +11:00
Marc Durdin
11bde6fc7e fix(windows): setup should ignore cert revocation
Fixes #4385.

Chrome has ignored certificate revocation for many years. If it's
good enough for Chrome, it's good enough for us. Right?

More seriously, sometimes Windows has trouble with its certificate
revocation cache, and it seems to be difficult to predict when this
will happen. This results in error 12057.

https://knowledge.broadcom.com/external/article/169185/ssl-visibility-how-to-resolve-the-certi.html
https://www.imperialviolet.org/2012/02/05/crlsets.html
2021-02-02 06:29:50 +11:00
Marc Durdin
f83c8ebbe5 fix(windows): Show balloon when Keyman is already running
Fixes #4192.

If Keyman is already running, and the user attempts to start Keyman
again, a balloon will be shown to direct the user to the right place on
the screen.

Note: this worked in earlier versions of Keyman but stopped working due
to name changes for windows in the app.

I have also added a new string for balloon that will need translation.
2021-02-01 16:06:08 +11:00
Marc Durdin
ba9ecb6095 fix(windows): Ensure UAC window comes to foreground
Fixes #3936.

This is a trial change as I am not able to reproduce the problem on my
machine, probably due to timing.

@makarasok, can you please test if this resolves the UAC window not
coming to foreground on your test scenario for #3936?
2021-02-01 15:29:06 +11:00
Marc Durdin
302107baa6 fix(windows): When uninstalling, exit Keyman
Fixes #4185.

Make sure Keyman is shut down during the uninstall so that it isn't left
in a weird state with missing files. This also reduces the need for a
reboot after uninstall.
2021-02-01 15:25:17 +11:00
Marc Durdin
348b29687e fix(windows): avoid invalid language codes in Add Language dialog
Fixes #4343.

This patch makes all language codes from the langtags.json dataset
visible through the Add Language dialog. This avoids situations where
an incomplete code such as "cmo" can result in an error (a script is
required for "cmo" as it is written in either Latn or Khmr).
2021-02-01 10:20:19 +11:00
Marc Durdin
fdcb8191a8 fix(windows): crash for Sinhala mitigation
Fixes #4337.

The Sinhala language installation mitigation needed the BCP 47 code as
well as the language code with the new language installation process.
2021-02-01 08:30:16 +11:00
Marc Durdin
335f06661d fix(windows): remove Show Keyboard Usage hotkey
Fixes #4336.

Removes the "Show Keyboard Usage Page" hotkey entry as it has no effect,
and cleans up Keyboard Usage and OSK Hint strings from all the current
locales.
2021-02-01 07:58:05 +11:00
Marc Durdin
07e9402f0c fix(windows): Refresh setings on 64-bit apps
Fixes #4289.

Some settings changes would not apply immediately for 64-bit apps, as
the refresh was not being processed until keymanx64 received focus (i.e.
never, as keymanx64 does not have a visible window!)
2021-02-01 07:42:20 +11:00
Marc Durdin
95e086feb9
Merge pull request #4349 from keymanapp/fix/windows/4186-enter-spacebar-in-config
fix(windows): Enter and Spacebar handling in Configuration
2021-02-01 06:29:08 +11:00
Marc Durdin
240ce8d3d6
Merge pull request #4360 from keymanapp/fix/windows/4196-surrogate-pair-deletions-tsf-aware
fix(windows): SMP-aware deletion in TSF-aware apps
2021-02-01 06:25:37 +11:00
Darcy Wong
a0b2fdb625
Merge pull request #4367 from keymanapp/chore/windows/more-titles-and-todos
chore(windows/resources): Fix more titles and TODOs in help
2021-01-29 10:05:53 +07:00
Darcy Wong
7bd55db3fa chore(windows/resources): Tweak formatting in locale_edit 2021-01-28 14:56:48 +07:00
Darcy Wong
57c78625c6 chore(windows/resources): Add link to troubleshooting/hidden 2021-01-28 14:44:47 +07:00
Darcy Wong
2d0e8490bb chore(windows/resources): Add troubleshooting/hidden 2021-01-28 14:38:08 +07:00
Darcy Wong
41bb899164 chore(windows/resources): Add titles to other index pages
* common/editions were removed in #4105
2021-01-28 14:15:36 +07:00
Darcy Wong
c4ef2221fb chore(windows/resources): Update context help titles
* Fix titles
* Remove unused osk_usage.md
* Remove link to osk_usage because the actual link is onscreenkeyboard
* Fix link to charactermap
* Remove unused links to psrt*language
2021-01-28 14:15:36 +07:00
Marc Durdin
eb3f8d658b fix(windows): Ignore Access Denied error creating task
Fixes #4116.
Fixes KEYMAN-WINDOWS-5T.

If we get an 'access denied' error, we won't report it to Sentry. This
error is of minor consequence as it arises in normal configurations only
if the task was already present, created by an elevated instance of
kmshell under the same user name. In that situation, the task works
fine; it just cannot be updated by a non-elevated instance of kmshell.
If there are other reasons for receiving access denied, we won't be able
to distinguish them anyway, so the best response is to suppress this
message.

An alternative would have been to either (a) avoid creating the task as
an elevated user, or (b) only ever create the task as an elevated user.
However, this adds extra unnecessary complexity and means that the task
may not always be present when we want it to be.
2021-01-28 14:13:45 +11:00
Marc Durdin
c194793a76
Merge pull request #4348 from keymanapp/fix/windows/4265-splash-button-sizes
fix(windows): Splash button sizes
2021-01-28 13:50:20 +11:00
Marc Durdin
0ae102a0d3
Merge pull request #4362 from keymanapp/fix/windows/setup-strings-comment-for-language
fix(windows): setup strings comment for language
2021-01-28 13:50:13 +11:00
Darcy Wong
4712762e9f chore(windows/resources): Use newer version of Word knowledge base 2021-01-28 06:31:26 +07:00
Marc Durdin
daa021ae85 fix(windows): setup strings comment for language 2021-01-28 08:53:15 +11:00
Marc Durdin
193478a492 fix(windows): Reverse order of backspaces
In order for the BK_SURROGATE and BK_DEADKEY flags to be matched with
the correct xstring elements in the context, we need to delete the
elements from the buffer in reverse order.

decxstr would previously assert if attempting to move before start of
string. This is undesirable behaviour as it should instead return NULL
to indicate that we've finished the string.

I also corretected a buffer underrun which would be possible if
malformed data was in the xstring.

I checked all uses of decxstr to ensure that the NULL return value is
being tested correctly.
2021-01-28 08:16:33 +11:00
Marc Durdin
098de3af78 fix(windows): SMP-aware deletion in TSF-aware apps
Fixes #4196.

When deleting characters in a TSF-aware app, we must delete both halves
of a surrogate pair. This behaviour differs from legacy apps, where a
single backspace is usually sufficient to delete both characters.

Truly ancient apps that do not know about Unicode surrogate pairs are
not going to delete both halves with a single backspace event.
Fortunately, these are few and far between; we would handle them on a
case-by-case basis if support questions for them arise.

When we come to integrating Keyman Core into Keyman for Windows, there
will need to be some careful checking of surrogate pair support, as it
is likely that the handling will need to change.
2021-01-28 07:37:05 +11:00
Darcy Wong
5c4eaffb87 chore(windows/resources): Use full paths to help site 2021-01-27 14:59:59 +07:00
Darcy Wong
5368e28425 chore(windows/resources): Copy desktop/current-version landing page 2021-01-27 13:41:04 +07:00
Marc Durdin
b97c5d293d fix(windows): Enter and Spacebar handling in Configuration
Fixes #4186.

The Enter and Spacebar key handlers had not been updated for the new
layout and so threw errors in use.
2021-01-27 15:23:19 +11:00
Marc Durdin
0d5a35f237 fix(windows): Splash button sizes
Fixes #4265.

This adjusts the button sizes of the splash screen to accommodate longer
strings such as found in the Khmer translation. We could go to a more
flexible layout model to allow for the buttons to stretch as needed, but
that's a lot more work and I don't really want to try for that right
now.
2021-01-27 15:04:45 +11:00
Darcy Wong
ee6909fa18 chore(windows/resources): Fix character map table formatting 2021-01-27 10:10:58 +07:00
Darcy Wong
00457e9ffe chore(windows/resources): Fix broken link to start/font 2021-01-27 10:10:25 +07:00
Darcy Wong
f2ea74f7f7 chore(windows/resources): Fix anchor link to Step 5 2021-01-27 09:37:40 +07:00