-
Notifications
You must be signed in to change notification settings - Fork 6k
Restore creation of engine before Linux widget is realized. #53604
Restore creation of engine before Linux widget is realized. #53604
Conversation
With the changes in 9463b5d we were now taking two weak references using different methods. A later change showed reference errors in the tests, which seem to be solved by removing this change. Instead use a private shutdown method, which is clearer in any case.
This is for consistency with the other weak references. The newer API is thread safe.
Due to changes in the renderer in 6b857de the engine was created once a widget is realized, not when the widget is created. If a Flutter application changed the default my_application.cc template to show the Flutter widget after plugins are run then these plugins would not be able to access the engine. Solved by removing the GdkWindow from the renderer constructor and setting in later when the widget is realized. This works because the renderer is not used until the widget is realized. Fixes flutter/flutter#144873
|
Note this change also includes fixes for the weak reference handling which were causing the tests to crash after this change. This change should not be squashed so these commits are separate from the fix. |
|
@spydon please confirm if this fixes the issue for you. |
cbracken
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Kicked the failing mac bot. Looked like a Metal related flake unrelated to your change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm! Tried it on our the installer and the app center and it works with the plugins.
We still have the (most likely unrelated) issue where the start-up screen is black:
Screencast from 2024-07-01 14-56-54.webm
EDIT: The above only happens in debug mode
Opened flutter/flutter#151098 for that issue
…151156) flutter/engine@d3c5bd6...40c087b 2024-07-02 [email protected] Restore creation of engine before Linux widget is realized. (flutter/engine#53604) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…lutter#151156) flutter/engine@d3c5bd6...40c087b 2024-07-02 [email protected] Restore creation of engine before Linux widget is realized. (flutter/engine#53604) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…lutter#151156) flutter/engine@d3c5bd6...40c087b 2024-07-02 [email protected] Restore creation of engine before Linux widget is realized. (flutter/engine#53604) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
|
I had thought this would be cherry-picked for a hotfix, but it still seems broken today with Flutter 3.22.3 - is the fix only available in |
|
Great, proposing for a cherry pick. |
|
Failed to create CP due to merge conflicts. |
|
This is now in 3.24, I won't propose it for 3.22 unless there is a need. |
|
Excellent! Thank you for all your hard work! 🙇♀️ I appreciate you 💙 😁 |
|
Thank you very much... it was very important. |

Due to changes in the renderer in 6b857de the engine was created once a widget is realized, not when the widget is created. If a Flutter application changed the default my_application.cc template to show the Flutter widget after plugins are run then these plugins would not be able to access the engine.
Solved by removing the GdkWindow from the renderer constructor and setting in later when the widget is realized. This works because the renderer is not used until the widget is realized.
Fixes flutter/flutter#144873