-
Notifications
You must be signed in to change notification settings - Fork 555
[AndroidViewSurface] On app resume, a hidden UnityWidget renders on top of other widgets. #647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
After testing on fuw 2022.1.0+7 and Flutter 2.10.5, it seems to be surfaceView related. Flutter 3 compatible versions require using androidViewSurface, therefore this is a regression in versions 2022.1.1+x. |
@juicycleff Can you look on that issue? |
does this also happen on Flutter Stable 3.0.5? |
@Ahmadre yes,it also happened on Flutter Stable 3.0.5. I donot kown how to fix it. @juicycleff Can you look on that issue? |
Did you try: @override
void didChangeAppLifecycleState(AppLifecycleState state) {
switch (state) {
case AppLifecycleState.resumed:
unityWidgetController.resume();
break;
case AppLifecycleState.paused:
unityWidgetController.pause();
break;
default:
}
} For more read Flutter's: WidgetsBindingObserver |
Seems like a Flutter 3.0.0 issue taking a look |
It doesn't seem related to Flutter 3. In Flutter 2.10.5 the bug only happens with In Flutter 3.3.0-0.0.pre the bug only happens with |
Still able to reproduce the issue. Unity's new input system doesn't seem to work with |
Just tried it again in Flutter 3.7.0 on Android 13. screen_recording.mp4I found this Hybrid composition issue in the Flutter repo that seems like the same problem. flutter/flutter#89558 |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
This is a bug that occurs when a UnityWidget is kept alive in the widget tree, but hidden by another widget.
In the following example the UnityWidget is in a Pageview, where it can be hidden by another page.
When you leave the app and return it from the background, the UnityWidget renders on top of the visible page, and does not detect touch input.
This only happens in Hybrid composition mode, which is enabled with
useAndroidViewSurface: true
.To Reproduce
Steps to reproduce the behavior:
android/unityLibrary
Unity does not respond to touch events until you switch to the unity page again.
Expected behavior
The Platformview is only shown when the UnityWidget is visible in the widget tree. In the example only on the blue page.
Video
Screen_Recording_20220706-125630.mp4
Code sample
Paste the following code in main.dart of the flutter_unity_widget example project.
code to reproduce the issue
Versions
[UPDATE]
Still a problem with:
The text was updated successfully, but these errors were encountered: