From 489d0cbfa6278a7dcd070de667c4ef5916d695c6 Mon Sep 17 00:00:00 2001 From: Jacalz Date: Thu, 16 Jan 2025 20:16:10 +0100 Subject: [PATCH 1/2] Clear out pending window operations after start --- internal/driver/glfw/window_desktop.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/driver/glfw/window_desktop.go b/internal/driver/glfw/window_desktop.go index 373ef9104e..1653652c15 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 // Clear out any pending operations. if w.FixedSize() && (w.requestedWidth == 0 || w.requestedHeight == 0) { bigEnough := w.canvas.canvasSize(w.canvas.Content().MinSize()) From aa18bf75edd7d324933cd780955ba1b2808f35e2 Mon Sep 17 00:00:00 2001 From: Jacalz Date: Thu, 16 Jan 2025 20:22:46 +0100 Subject: [PATCH 2/2] Remove useless comment --- internal/driver/glfw/window_desktop.go | 2 +- internal/driver/glfw/window_test.go | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/driver/glfw/window_desktop.go b/internal/driver/glfw/window_desktop.go index 1653652c15..481313ec1b 100644 --- a/internal/driver/glfw/window_desktop.go +++ b/internal/driver/glfw/window_desktop.go @@ -789,7 +789,7 @@ func (w *window) create() { for _, fn := range w.pending { fn() } - w.pending = nil // Clear out any pending operations. + 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 831392ce55..a0235d9a56 100644 --- a/internal/driver/glfw/window_test.go +++ b/internal/driver/glfw/window_test.go @@ -1745,9 +1745,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()