-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Calling SetContent from Window OnDropped can freeze application #4624
Comments
While searching for existing code that uses It looks like someone else already found the bug and also found a workaround. This works: package main
import "fyne.io/fyne/v2"
import "fyne.io/fyne/v2/app"
import "fyne.io/fyne/v2/widget"
func main() {
a := app.New()
w := a.NewWindow("test")
w.SetOnDropped(func(pos fyne.Position, uris []fyne.URI) {
go func() { w.SetContent(widget.NewLabel("File dropped")) }()
})
w.ShowAndRun()
} |
Updated title to be freeze not crash as they are quite different |
Fixed on Develop branch, but it probably missed v2.4.4 - if we do 2.4.5 before 2.5.0 then this should be in it |
Awesome, thanks for the lightning fast fix, @andydotxyz ! I'll try to test it with the development branch, when I find some time. |
I've now tested on the |
Milestone v2.4.5 had been set for this issue, but the fix has not been released with v2.4.5. Was this ticket missed when preparing the release or was this a conscious choice? |
You're right this was missed somehow. |
No worries and thanks for the quick action ❤️ |
Checklist
Describe the bug
I have added a
SetOnDropped
handler to the main window of my application. If the handler just does something trivial, like printing to stdout, everything works as expected. If, however, the handler callsSetContent
on the window, theSetContent
is run and then the application freezes forever.How to reproduce
I can create the problem by running the test program and dropping a file into the application window.
Screenshots
No response
Example code
Fyne version
2.4.3
Go compiler version
1.22.0
Operating system and version
MX Linux, I believe version 21; it's basically Debian
Additional Information
No response
The text was updated successfully, but these errors were encountered: