Removes koRunElevatedInVista, koSwitchLanguageForAllApplications,
koSwitchLanguageWithKeyboard, koUnknownLanguage, koTurnOnSurrogates
from localizations and from UI.
These options are no longer relevant, mostly due to improved operating
system support.
Only one option was still visible, koSwitchLanguageForAllApplications,
so this has been hidden in keyman_options.xsl, for future full removal.
This makes it easier to track what is happening for errors where
otherwise we found that exception messages were being cropped; for
example, see KEYMAN-WINDOWS-X.
The error messages were being cropped because the exception handler was
in the exe module, but the exception was being raised in kmcomapi
module. When the exception was handled, the handler tested to see if
the exception object inherited from exemodule.Exception, but it was
inheriting from kmcomapi.Exception instead, and so it did not attempt
to load the message detail.
By adding `safecall` calling convention to `KeymanCustomisation`, we
move responsibility for handling the exception to the
`TKeymanAutoObject.SafeCallException` function, and we get full detail
for the exception.
Adds Sentry breadcrumbs for the following crash reports:
* KEYMAN-WINDOWS-62
* KEYMAN-WINDOWS-6H (? no reports in recent releases, so may be
resolved)
* KEYMAN-WINDOWS-7J
* KEYMAN-WINDOWS-4R
The source of these crashes is hard to pinpoint, so hoping that this
additional data sheds some light.
Fixes#7698.
Due to a `>` instead of a `>=` check, there was a one pixel high box at
the bottom of each list of input methods for each language which would
reuslt in an invalid value for `FNewHoverKeyboard`
(`lang.KeyboardCount`).
As well as fixing this, I changed the result for clicking below the
input method list to the more logical last item in the list rather than
the first.
Fixes#7690.
When kmshell.dpr is being shut down by Windows via `WM_ENDSESSION`, the
order of termination of units through `finalization` sections means that
`IdStackWindows` was finalizing while components were still depending on
it, causing a cascade of exceptions resulting eventually in the crash
visible in #7690.
We saw this when there were message loops before `Application.Run` had
ever been called. For example, message box/dialog, ShellExecute (yep...
this can do a `PeekMessage`), `THttpUploader` (which calls
`Application.ProcessMessages`) and probably others.
Ideally, it would be better to always call `Application.Run`, but it is
not safe to call `Application.Run` more than once, because it ends up
adding multiple `DoneApplication` exit procs, which would likely cause
other crashes.
I landed on the somewhat heavy-handed solution of adding
`IdStackWindows` to the start of the project `uses` list, ensuring it is
the last unit to be finalized -- importantly, before `Vcl.Forms`. A
better solution would be to find a way of ensuring that
`Application.Run` is called, just once, in all situations, but this is
likely to be hard to achieve. The shutdown sequence for Delphi apps is
so very, very fragile.
Relates to KEYMAN-WINDOWS-B.
While this doesn't address the root cause of the exception, it should
prevent this unhandled exception, and adds breadcrumbs to help us see
which code path might be triggering the issue.
While Keyman Core already supported the base layout flags, they were not
being passed in from Keyman Engine for Windows. This meant that any
rules that used `baselayout` would fail, such as in sil_ipa with AltGr+0
for }
0bf72bed74/release/sil/sil_ipa/source/sil_ipa.kmn (L348-L350)
This patch adds support for the following properties:
* KM_KBP_KMX_ENV_BASELAYOUT: the legacy base layout name, e.g. kbdus.dll
* KM_KBP_KMX_ENV_BASELAYOUTALT: the BCP 47 base layout name, e.g. en-US
* KM_KBP_KMX_ENV_SIMULATEALTGR: whether the user has selected to emulate
AltGr with Ctrl+Alt, for example on laptops without a right alt key.
* KM_KBP_KMX_ENV_BASELAYOUTGIVESCTRLRALTFORRALT: whether the system base
layout in use generates Ctrl+RAlt when RAlt is pressed, which can be
true for many European system layouts. This is necessary when
associating the keyboard with a European language because the base
keyboard becomes the language's default keyboard, rather than kbdus.
Hopefully fixes KEYMAN-WINDOWS-1MR, and probably many related crash
reports. Will monitor on alpha before porting to stable/beta.
This changes the form destruction sequence to make sure that it
doesn't close the form until CEF has been shutdown correctly.