Skip to content

application: take tray v0.7.1, where what the tray shows is locked - #1

Merged
tannevaled merged 1 commit into
mainfrom
the-tray-fields-are-locked-now
Aug 30, 2026
Merged

application: take tray v0.7.1, where what the tray shows is locked#1
tannevaled merged 1 commit into
mainfrom
the-tray-fields-are-locked-now

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

tray's icon, tooltip and menu were plain fields. The platform loop reads all three to draw them, and an application that changes its menu when its state changes writes them from wherever that state lives. The race detector caught it in another consumer (go-xrkit/desk, through tray.BindIcon); on a Mac it is the AppKit main loop reading a slice header another goroutine is replacing. tray v0.7.1 puts them behind an RWMutex.

Nothing here changes shape — the upgrade is additive — but every application built on this package gets the fix, which is the reason this package exists to be upgraded once rather than each of them separately.

Tests pass, including under -race.

The icon, the tooltip and the menu were plain fields in tray: the
platform loop reads all three to draw them, and an application changing
its menu when its state changes writes them from wherever that state
lives. The race detector caught it in another consumer; on a Mac it is
the AppKit main loop reading a slice header another goroutine is
replacing.

Nothing here changes shape -- the upgrade is additive -- but every
application built on this package gets the fix, which is the reason this
package exists to be upgraded once instead of each of them separately.
@tannevaled
tannevaled merged commit 0e8af14 into main Aug 30, 2026
5 checks passed
@tannevaled
tannevaled deleted the the-tray-fields-are-locked-now branch August 30, 2026 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant