-
Notifications
You must be signed in to change notification settings - Fork 6k
[windows] Mostly eliminate the state structs #20662
[windows] Mostly eliminate the state structs #20662
Conversation
The Windows embedding was based on the GLFW embedding, which grew organically from a singe-file implementation that used structs to manage all of the important state. It is in the process of being converted to a cleaner object-based architecture, but currently it is a hybrid of objects and structs that have redundant data, making it very prone to errors of forgetting to update pointers in multiple locations. This reduces the remaining structs to only a single pointer to the larger object that manages the responsibilities that handle is associated with, so that there is no need to wire things together in multiple places. For now they continue to exist as projections of the larger objects, but that will be eliminated over time by having an object structure that better reflects the API structure. Fixes flutter/flutter#64250
|
../../flutter/shell/platform/embedder/embedder.cc (1360): 'FlutterEngineSendPlatformMessage' returned 'kInvalidArguments'. Invalid engine handle. [√] Flutter (Channel master, 1.21.0-10.0.pre.212, on Microsoft Windows [Version 10.0.19041.264], locale en-US) [√] Android toolchain - develop for Android devices (Android SDK version 30.0.2) [√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.7.2) [√] Android Studio (version 4.0) [√] Connected device (1 available) • No issues found! |
|
I'm not sure what the purpose of your comment is; I'm obviously aware of the bug this PR fixed given that it's referenced in the PR description. |
|
I just mentioned that I upgraded to new version and it's not fixed yet. |
Since your engine version is older than this fix, it would be surprising if it were fixed. |
|
Sure 😃 |
Description
The Windows embedding was based on the GLFW embedding, which grew
organically from a singe-file implementation that used structs to manage
all of the important state. It is in the process of being converted to a
cleaner object-based architecture, but currently it is a hybrid of
objects and structs that have redundant data, making it very prone to
errors of forgetting to update pointers in multiple locations.
This reduces the remaining structs to only a single pointer to the
larger object that manages the responsibilities that handle is
associated with, so that there is no need to wire things together in
multiple places.
For now they continue to exist as projections of the larger objects, but
that will be eliminated over time by having an object structure that
better reflects the API structure.
Related Issues
Fixes flutter/flutter#64250
Tests
I added the following tests: None. (Testing backfill for this embedding will be a late-Q3/Q4 priority.)
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.Breaking Change
Did any tests fail when you ran them? Please read handling breaking changes.