diff --git a/internal/driver/glfw/window_desktop.go b/internal/driver/glfw/window_desktop.go index 373ef9104e..481313ec1b 100644 --- a/internal/driver/glfw/window_desktop.go +++ b/internal/driver/glfw/window_desktop.go @@ -789,6 +789,7 @@ func (w *window) create() { for _, fn := range w.pending { fn() } + w.pending = nil if w.FixedSize() && (w.requestedWidth == 0 || w.requestedHeight == 0) { bigEnough := w.canvas.canvasSize(w.canvas.Content().MinSize()) diff --git a/internal/driver/glfw/window_test.go b/internal/driver/glfw/window_test.go index 3a2a61e324..41b4f8d550 100644 --- a/internal/driver/glfw/window_test.go +++ b/internal/driver/glfw/window_test.go @@ -1746,9 +1746,8 @@ func TestWindow_SetContent_Twice(t *testing.T) { } func TestWindow_SetFullScreen(t *testing.T) { - var w *window runOnMain(func() { // tests launch in a different context - w = d.CreateWindow("Full").(*window) + w := d.CreateWindow("Full").(*window) w.SetFullScreen(true) w.create()