From 684dc961e82f3b24a3cca1b2b9ca11f34b3b6ffe Mon Sep 17 00:00:00 2001 From: Stu Leak Date: Sat, 29 Nov 2025 20:25:57 -0500 Subject: [PATCH] Fix Fyne threading error by using async Do() instead of DoAndWait() The setContent function was calling fyne.DoAndWait() from the main goroutine, which created a deadlock. Changed to use fyne.Do() (asynchronous) to properly marshal UI updates without blocking. This resolves the error: 'fyne.Do[AndWait] called from main goroutine' The async approach is correct here since we don't need to wait for the content update to complete before continuing. --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 4830ee5..b622d42 100644 --- a/main.go +++ b/main.go @@ -346,8 +346,8 @@ func (s *appState) setContent(body fyne.CanvasObject) { s.window.SetContent(container.NewMax(bg, body)) } - // Always marshal content changes onto the Fyne UI thread - fyne.DoAndWait(update) + // Use async Do() instead of DoAndWait() to avoid deadlock when called from main goroutine + fyne.Do(update) } // showErrorWithCopy displays an error dialog with a "Copy Error" button