fyne-io / fyne

Cross platform GUI toolkit in Go inspired by Material Design
https://fyne.io/
Other
24.82k stars 1.37k forks source link

Android: EGL_BAD_SURFACE fails to redraw app after OpenFile dialog closes #3541

Open marystern opened 1 year ago

marystern commented 1 year ago

Checklist

Describe the bug

On Android v9 (moto g6) with fyne v2.3.0, I pop up an OpenFileDialog and close it, and then the main app window fails to get re-drawn (appears empty/blank) and reports:

01-05 22:25:17.390 6458 6484 I Fyne : app: failed to swap buffers (EGL_BAD_SURFACE) 01-05 22:25:17.400 6458 6484 I Fyne : app: failed to swap buffers (EGL_BAD_SURFACE)

How to reproduce

see note below in code section

Screenshots

No response

Example code

.. just call this in app.Lifecycle().OnStarted(): dialog.ShowFileOpen(fileChosen, parent) and run on Android and observe adb logcat | grep Fyne

Fyne version

2.3.0

Go compiler version

go version go1.19.4 linux/amd64

Operating system

Android

Operating system version

9

Additional Information

(I vaguely remember a similar problem a few years ago where iterating the surfaces gave an unusable one first, and the fix was to find another one that worked! Sorry I have no further info to hand)

marystern commented 1 year ago

(might be completely unrelated, but for background info at least: https://github.com/flutter/flutter/issues/59960 )

andydotxyz commented 1 year ago

Can you please confirm whether or not you see the same behaviour with the fyne_demo app which uses the file pickers too.

marystern commented 1 year ago

Can you please confirm whether or not you see the same behaviour with the fyne_demo app which uses the file pickers too.

no, the fyne_demo seems to work fine (pun intended) :)

andydotxyz commented 1 year ago

.. just call this in app.Lifecycle().OnStarted(): dialog.ShowFileOpen(fileChosen, parent) and run on Android and observe adb logcat | grep Fyne

You shouldn't ask the UI to show things on "Started". What happens if you move this to "Focused" instead (yes you'll need a little more code to avoid doing it every time the app comes to foreground).