From 773655ef9c299d402a89318a86c597a549533c72 Mon Sep 17 00:00:00 2001 From: "5684185+vsariola@users.noreply.github.com" <5684185+vsariola@users.noreply.github.com> Date: Fri, 11 Oct 2024 16:08:55 +0300 Subject: [PATCH] fix(tracker/gioui): avoid deadlock while changing window title --- tracker/gioui/tracker.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tracker/gioui/tracker.go b/tracker/gioui/tracker.go index ff7b6e9..01e7acc 100644 --- a/tracker/gioui/tracker.go +++ b/tracker/gioui/tracker.go @@ -113,14 +113,6 @@ func (t *Tracker) Main() { go eventLoop(w, events, acks) var ops op.Ops for { - if titleFooter != t.filePathString.Value() { - titleFooter = t.filePathString.Value() - if titleFooter != "" { - w.Option(app.Title(fmt.Sprintf("Sointu Tracker - %v", titleFooter))) - } else { - w.Option(app.Title(fmt.Sprintf("Sointu Tracker"))) - } - } select { case e := <-t.PlayerMessages: t.ProcessPlayerMessage(e) @@ -141,6 +133,14 @@ func (t *Tracker) Main() { go eventLoop(w, events, acks) } case app.FrameEvent: + if titleFooter != t.filePathString.Value() { + titleFooter = t.filePathString.Value() + if titleFooter != "" { + w.Option(app.Title(fmt.Sprintf("Sointu Tracker - %v", titleFooter))) + } else { + w.Option(app.Title(fmt.Sprintf("Sointu Tracker"))) + } + } gtx := app.NewContext(&ops, e) if t.SongPanel.PlayingBtn.Bool.Value() && t.SongPanel.NoteTracking.Bool.Value() { t.TrackEditor.scrollTable.RowTitleList.CenterOn(t.PlaySongRow())