-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Crash when resizing window on MacOS #1051
Comments
I cannot replicate this on the same hardware. |
Edit: Forgot to say I'm on Windows I encountered a similar error when using this code, and resizing the window I have a suspicion it is something to do with my display Here is the code package main
import (
"fyne.io/fyne/widget"
"fyne.io/fyne/app"
)
func main() {
app := app.New()
w := app.NewWindow("Hello")
w.SetContent(widget.NewVBox(
widget.NewLabel("Hello Fyne!"),
widget.NewButton("Quit", func() {
app.Quit()
}),
widget.NewButton("New Window",func() {
w2 := app.NewWindow("Another Window")
w2.SetContent(widget.NewLabel("Hello again!"))
w2.ShowAndRun()
}),
))
w.ShowAndRun()
} Console outputrohan@DESKTOP-Q4LRFRP MINGW64 ~/source/repos/GoApp $ go run main.go 2020/06/01 14:57:02 PlatformError: WGL: Failed to make context current Exception 0xc0000005 0x0 0x37d0 0x7ffcc7b5c638 PC=0x7ffcc7b5c638runtime: unknown pc 0x7ffcc7b5c638 goroutine 18 [syscall]: goroutine 1 [syscall, locked to thread]: goroutine 6 [sleep]: goroutine 7 [chan receive]: goroutine 8 [syscall, locked to thread]: goroutine 9 [chan receive]: goroutine 19 [chan receive]: goroutine 10 [chan receive]: goroutine 34 [chan receive]: goroutine 35 [chan receive]: goroutine 21 [chan receive]: |
The screenshot you provided looks like it's not running our 'develop' branch which means a lot has changed already. We re-wrote quite a bit of scale and resize/paint handling. |
I already have the master branch version of Fyne installed. Will I have to remove my existing Fyne install? Also, can you guide me towards instructions to install the latest develop branch? Thanks. |
You do not have to remove it, you can install over the top. The following should be sufficient for an existing installation: cd $GOPATH/src/fyne.io/fyne/cmd/fyne
git checkout develop
git pull
go install Then run fyne_demo again and you should see it has different tabs. Let us know if this changes the situation. |
It looks like the parameters are valid and that it's running on the right thread - might need a bit more digging at your send to inspect the values to see which is corrupting or causing unexpected state? |
The fyne_demo looks good. The buttons are a little too big. I'm not too sure how the scaling works, but maybe it is possible to change the scale based on screen resolution? The code that I wrote in my previous comment crashed with a different error message, and it didn't crash when I resized it, it crashed immediately after opening a new window. package main
import (
"fyne.io/fyne/app"
"fyne.io/fyne/widget"
)
func main() {
var app = app.New()
var w = app.NewWindow("Hello")
w.SetContent(widget.NewVBox(
widget.NewLabel("Hello Fyne!"),
widget.NewButton("Quit", func() {
app.Quit()
}),
widget.NewButton("New Window",func() {
var w2 = app.NewWindow("Another Window")
w2.SetContent(widget.NewLabel("Hello again!"))
w2.ShowAndRun() /*will crash*/
}),
))
w.ShowAndRun()
} Console Outputrohan@DESKTOP-Q4LRFRP MINGW64 ~/source/repos/GoApp (master) $ go run main.go panic: Run() or ShowAndRun() must be called from main goroutinegoroutine 34 [running]: |
Don’t call ShowAndRun() a second time, use just Show(). |
If you want things to be a little smaller then run the included fyne_settings app and choose “smaller” :) |
Thanks, but for some reason I was not able to run fyne_settings from my terminal. I had to go into /go/src/fyne.io/fyne/cmd/fyne_settings and do |
Reports are that this does not happen since 1.3.0 according to @toaster |
Not sure if this is right the issue for this, but fyne v2.1.1 still crash on macOS when resizing windows.
EDIT: 2.1.2 seems to fix it |
Are you on an M1 machine by any chance? A similar issue should have been fixed with v2.1.2, which currently is the latest release. |
Yes, M1, just tested with 2.1.2, seems working, updated my first post |
When resizing a window on MacOS (10.14) a Fyne app (e.g. fyne_demo) eventually crashes:
crash1.txt
Branch: develop (85790ee)
The text was updated successfully, but these errors were encountered: