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.
This commit is contained in:
Stu Leak 2025-11-29 20:25:57 -05:00
parent 47f07e3447
commit 684dc961e8

View File

@ -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