Skip to content

Commit

Permalink
fix(tracker/gioui): avoid deadlock while changing window title
Browse files Browse the repository at this point in the history
  • Loading branch information
vsariola committed Oct 11, 2024
1 parent 91b7850 commit 773655e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tracker/gioui/tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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())
Expand Down

0 comments on commit 773655e

Please sign in to comment.