From 79440c0945263fce7373efcd25cf2fbf710d4911 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Thu, 7 May 2026 20:40:09 +0200 Subject: [PATCH] Set the view color on the UI thread too Unrelated to this branch, just because we're touching this code: there's little reason to set the color on the background thread but the text on the UI thread. Set them both together on the UI thread. Avoids a data race (unlikely to be a problem in practice, we're talking about a 64-bit int, but still). --- pkg/gui/controllers/helpers/app_status_helper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/gui/controllers/helpers/app_status_helper.go b/pkg/gui/controllers/helpers/app_status_helper.go index 83500d3a7..fa402962c 100644 --- a/pkg/gui/controllers/helpers/app_status_helper.go +++ b/pkg/gui/controllers/helpers/app_status_helper.go @@ -97,7 +97,6 @@ func (self *AppStatusHelper) renderAppStatus() { prevAppStatus := "" for range ticker.C { appStatus, color := self.statusMgr().GetStatusString(self.c.UserConfig()) - self.c.Views().AppStatus.FgColor = color update := self.c.OnUIThreadContentOnly if utils.StringWidth(appStatus) != utils.StringWidth(prevAppStatus) { @@ -108,6 +107,7 @@ func (self *AppStatusHelper) renderAppStatus() { update = self.c.OnUIThread } update(func() error { + self.c.Views().AppStatus.FgColor = color self.c.SetViewContent(self.c.Views().AppStatus, appStatus) return nil })