The Windows and GLFW embeddings both had cases of missing returns after
calling `Error` on a method channel result object, leading to incorrect
double-calls on the result if the error paths were ever hit.
This switches from using dispatchKeyEvent to using dispatchKeyEventPreIme so that keys can be intercepted before they reach the IME and be handled by the framework.
It also now intercepts key events sent to InputConnection.sendKeyEvent, as some IMEs do (e.g. the Hacker's Keyboard), and sends the to Flutter before sending them to the IME (which it now only does if they are not handled by the framework).
This fixes the problem where pressing TAB on a hardware keyboard sends the tab to both the text field and to the focus traversal system.
Note that we still can't intercept all keystrokes given to a soft keyboard, only those which the soft keyboard decides to send to InputConnection.sendKeyEvent.
Skia is removing the deprecated legacy display setting globals and
associated kLegacyFontHost_InitType. This change replaces all such uses
with default surface properties with no special flags and an unknown
pixel geometry. Flutter never set the associated globals, leaving them
with their initial default values, which were no special flags and
horizontal RGB pixel geometry. The values used here are different but
this change should make no difference as Flutter never mentions
SkFont::kSubpixelAntiAlias to take advantage of the pixel geometry.
Replaces the (temporary) compile-time option to pass engine switches
with the ability to pass them temporarily at runtime via environment
variables. This moves the recently-added code for doing this on Windows
to a shared location for use by all desktop embeddings.
This is enabled only for debug/profile to avoid potential issues with
tampering with released applications, but if there is a need for that in
the future it could be added (potentially with a whitelist, as is
currently used for Dart VM flags).
Temporarily adds a way to enable mirrors as a compile time option,
as is already provided in the Linux embedding, to provide a migration
path for the one remaining known need for compile-time options
that has been raised in flutter/flutter#38569.
This is not used anywhere in the engine. However, this API is easy to misuse as
one might incorrectly assume that it releases the reference on the underlying
object. Callers must use `reset` for this purpose.
* Remove unnecessary `?`s from web_ui.
In https://dart-review.googlesource.com/c/sdk/+/163841, dart's flow
analysis is being changed so that an assignment like this:
T? x = <non-nullable value>;
causes `x` to be immediately promoted to type `T`. This exposed two
instances in which a variable was unnecessarily given a nullable type.
To avoid warnings, we need to fix these two types before
https://dart-review.googlesource.com/c/sdk/+/163841 can land.