internal/uidriver/glfw: Bug fix: Rendering should be updated after restoring from fullscreen

u.toChangeSize affects the result of u.updateSize. When the callback
for WindowSetSize is invoked, toChangeSize should be true.

In order to simplify the logic, we have to remove toChangeSize later.

Closes #1884
This commit is contained in:
Hajime Hoshi 2021-11-27 17:53:37 +09:00
parent 7a850a15a9
commit 67d158b451

View File

@ -773,6 +773,10 @@ func (u *UserInterface) registerWindowSetSizeCallback() {
}
if err := u.runOnAnotherThreadFromMainThread(func() error {
// toChangeSize affects the result of updateSize (#1884).
// TODO: Remove toChangeSize to simplify the logic.
u.toChangeSize = true
// Disable Vsync temporarily. On macOS, getting a next frame can get stuck (#1740).
u.Graphics().SetVsyncEnabled(false)