See https://fxrev.dev/793422.
Missed in 92fca42e0667969b3a78815c77afca9c6acd1c83,
3bfa5c5b1db5391d49cc58f9a23f1b4cd802d3e3 and
d429b674f1dd60590fda077fd893a4493c2b5455.
This PR adds FlutterViewController.id, and formalizes how FlutterViewController is initialized by FlutterEngine:
When FlutterViewController is set to the engine, the engine calls FlutterViewController#attachToEngine:withId:.
When FlutterViewController is unset from the engine, the engine calls FlutterViewController#detachFromEngine.
This allows the ID to be generated by the engine.
The default View ID is now 1 instead of 0. In this way, we can use 0 as an empty value, the value for FlutterViewController.id when the FVC is not attached to an engine. (IDs are meant to be opaque, and views should be a map, not an array anyway.)
This PR moves almost all initialization code into FVC's CommonInit to ensure that all init path produces the expected result.
With this PR, FlutterEngine no long supports replacing viewController (from non-null to a different non-null). Setting the view controller (from null to non-null) is intended to allow pre-warming an engine before displaying it in add-to-app, but replacing the view controller does not make much sense.
If the developer wants to persist the state of the view between different windows, they could just attach the view controller to different windows.
In fact, Flutter doesn't even have a way to create a FlutterViewController that is unattached to an engine. All initializers either require an engine or create an engine.
As a result, unit tests that used to create FVC with the wrong initializer are fixed.
* [macos] Synthesize modifier keys events on pointer events
* Move test to FlutterViewControllerTest
* Simplify by using 'for in'
Co-authored-by: Bruno Leroux <bruno.leroux@gmail.com>
In 491db72 I replaced use of direct writes to cerr and replaced them
with FML_LOG calls but may have missed removing some iostream #includes,
or they may have been missed in previous cleanups. This removes any
remaining #includes of iostream that are unused.
Now that the embedders depend on FML, migrate assertions to FML_DCHECK,
which allows for an explanatory log message to be emitted along with the
assertion.
No tests since no semantic changes are made.
* Generate zip archives for Windows following target platform.
* Add CI builder for windows-arm64.
All packages can be cross compiled from an x64 machine.
Unittests are disabled, as they require an arm64 machine.
* Add windows-arm64 to CI.
`AddLocalChild(LocalComponent*)` is deprecated.
It was replaced by:
`AddLocalChild(LocalComponentFactory)`, which is a type alias for a
lambda that returns a `std::unique_ptr<LocalComponentImpl>`.
This change addresses problems that arised due to object lifetime
management of the components, and allows RealmBuilder to model the
component lifecycle of local components in a way that's more consistent
with other components.
The RealmBuilder-built `Realm` now owns the lifetime of the local
components, instead of the client, and those objects are valid until
the `Realm` is destroyed.
Bug: fxbug.dev/109804
* Undo axes flipping when using scroll wheel with shift key
* Formatting
* ++
* Fix test
* Fix for test
* Update shell/platform/darwin/macos/framework/Source/FlutterViewControllerTest.mm
* ++
* Fix format
* Review feedback
* Generate zip archives for Windows following target platform.
* Add CI builder for windows-arm64.
All packages can be cross compiled from an x64 machine.
Unittests are disabled, as they require an arm64 machine.
* Add windows-arm64 to CI.