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
examples/windowsize: pressing N to minimizes causes app to freeze #2932
Comments
It depends. You have to call |
Pressing N minimizes the window. When I click on it again the app is no longer running and I cannot close it nor do any other action. I have to force quit it. |
Oh? I'll try |
I failed to reproduce this.
|
I'm not sure why you can't reproduce it. I've cleared Go's cache, updated macOS since there were some Xcode changes and it still happens every time. |
What is your macOS version? |
Version 14.4 (23E214) |
I'll try to update. macOS14.4 seems notorious |
I failed to reproduce this 14.4 and the example still worked as expected:
My guess is that there is a very slight difference between my MacBook M3 Pro and yours. |
Very strange. I'll try to find what could be different |
Ok, I figured it out. I had Stage Manager enabled. After I disabled it the app seems to work as expected. Now why does stage manager cause the issue 🤔 |
The problem is This behavior is reproducible even in standard glfw 3.3:package main
import (
"fmt"
"runtime"
"github.com/go-gl/glfw/v3.3/glfw"
)
func init() {
// This is needed to arrange that main() runs on main thread.
// See documentation for functions that are only allowed to be called from the main thread.
runtime.LockOSThread()
}
func main() {
err := glfw.Init()
if err != nil {
panic(err)
}
defer glfw.Terminate()
window, err := glfw.CreateWindow(640, 480, "Testing", nil, nil)
if err != nil {
panic(err)
}
window.MakeContextCurrent()
var i = 0
for !window.ShouldClose() {
// delay the iconify process so the window can be fully loaded
// if it isn't fully loaded then the Iconify function actually does
// put the app in the tray.
if i > 1000 {
window.Iconify()
}
i++
fmt.Println(i, window.GetAttrib(glfw.Iconified))
// Do OpenGL stuff.
window.SwapBuffers()
glfw.PollEvents()
}
} Should we create a ticket in the GLFW project? |
That's interesting. This seems a bug in GLFW. If this is a serious issue, I'm fine to fix this in our internal/glfw.
Yes, if we can reproduce this without the Go binding. |
I don't think this is a serious issue since it only happens with Stage Manager enabled, and minimizing the window in software. The yellow minimize button works as expected. If you wanted a simple temporary fix you could just limit the number of attempts the for loop does to check if it has been minimized |
Sure. As this is not a serious issue, I'd like to hear what the GLFW people would say for this issue. Then let's consider how to fix Ebitengine (the best thing is to cherry-pick GLFW's fix) |
Ebitengine Version
@d15b12b4
Operating System
Go Version (
go version
)go version go1.22.1 darwin/arm64
What steps will reproduce the problem?
Press 'N' after running examples/windowsize
What is the expected result?
To minimize but still be runnable.
What happens instead?
The app freezes and becomes unresponsive even after returning focus.
Anything else you feel useful to add?
No response
The text was updated successfully, but these errors were encountered: