From f6e33914d9f806bb100c9e0abcbf9eeec2ecae16 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Thu, 30 May 2024 09:51:40 +0200 Subject: [PATCH] Revert "app: [Windows] ensure the Window is initalized before Run functions" This reverts commit 971b01d836291105ee3dd15b7956e0b6c78756cb because Option and Run no longer creates the window. Signed-off-by: Elias Naur --- app/os_windows.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/app/os_windows.go b/app/os_windows.go index b5614c0f..72489270 100644 --- a/app/os_windows.go +++ b/app/os_windows.go @@ -49,8 +49,7 @@ type window struct { // placement saves the previous window position when in full screen mode. placement *windows.WindowPlacement - animating bool - initialized bool + animating bool borderSize image.Point config Config @@ -105,6 +104,7 @@ func newWindow(win *callbacks, options []Option) { w.loop = newEventLoop(w.w, w.wakeup) w.w.SetDriver(w) err := w.init() + done <- struct{}{} if err != nil { w.ProcessEvent(DestroyEvent{Err: err}) return @@ -118,9 +118,6 @@ func newWindow(win *callbacks, options []Option) { // Since the window class for the cursor is null, // set it here to show the cursor. w.SetCursor(pointer.CursorDefault) - w.initialized = true - done <- struct{}{} - w.loop.FlushEvents() w.runLoop() }() <-done @@ -603,9 +600,7 @@ func (w *window) SetAnimating(anim bool) { func (w *window) ProcessEvent(e event.Event) { w.w.ProcessEvent(e) - if w.initialized { - w.loop.FlushEvents() - } + w.loop.FlushEvents() } func (w *window) Event() event.Event {