wasm: fix errors reported in console by wrapping given functions in fyne.Do#6103
wasm: fix errors reported in console by wrapping given functions in fyne.Do#6103schnoddelbotz wants to merge 2 commits intofyne-io:developfrom
Conversation
|
I am not that familiar with the wasm runtime but I think it's more likely that the main thread detection doesn't work on wasm (and therefore that these warnings are false positives) then that there's an actual threading issue. Especially since I'm pretty sure wasm is single-threaded |
andydotxyz
left a comment
There was a problem hiding this comment.
Elsewhere in this file we use runOnMain. Does it work if that fix is in place instead?
I think the change could be logical.
As @dweymouth says we may need to look at how the WASM GLFW works - but this seems like a good intermediate change - if we can match the pattern used elsewhere.
|
I took another look at this and parked resulting changes in another branch: Findings:
|
If runOnMain can deadlock then it means fyne.Do was not the right answer after all - it was just hiding deeper,
This is a separate issue I think - fyne-io/demo#4 |

Description:
The current fyne Demo on https://demo.fyne.io/ (2.6.0) as well as current https://github.com/fyne-io/demo throw errors in browser console, indicating that some function calls in
internal/driver/glfw/window_wasm.goshould be wrapped in Fyne.Do(), e.g.The error can be triggered by going to Widget->Entry and typing some characters into one of the text inputs.
The change in this PR just implements the fix indicated by the error message and successfully silences any corresponding error messages for me.
Checklist: