Skip to content

Fix themed tray cache isolation - #1560

Closed
IdelsTak wants to merge 2 commits into
qzind:tray-icon-cleanupfrom
IdelsTak:pr-1538-tray-icon-cleanup-review
Closed

IdelsTak wants to merge 2 commits into
qzind:tray-icon-cleanupfrom
IdelsTak:pr-1538-tray-icon-cleanup-review

Conversation

@IdelsTak

@IdelsTak IdelsTak commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

@tresf, this is a focused follow-up for #1538

What changed:

  • give each themed tray cache entry its own raster
  • cover ready and loading masks at every declared size

Why:

Light and Dark cache entries inherited the same BufferedImage

Recoloring either entry mutated shared state, which explains the always-white fallback icon and the cross-platform testColorsDiffer failure

Validation:

  • all seven upstream matrix jobs passed
  • Ubuntu, macOS, and Windows x86_64 tests passed
  • Ubuntu aarch64, Ubuntu riscv64, Windows aarch64, and macOS aarch64 jobs passed

Upstream CI run

Scope:

ad47cae is the cache isolation fix

8a6bbeb remains visible at your request, but after the wrapper design clarification it is not merge-ready

It gates selection on SystemTray.isSupported(), while the intended flow must attempt the platform tray and fall back only after loading or attachment fails

I’ll revisit that separately once the macOS and Windows flow is clear

macOS visual check:

Could you give the cache fix one visual pass when convenient?

In Light appearance, capture ready and Reload/loading, then switch to Dark without restarting and capture both again

Expected result is dark masks on Light, white masks on Dark, live refresh within a couple seconds, and sharp centered Retina icons without a stale frame or terminal error

Four screenshots are enough, or a short recording if Reload is too quick

@IdelsTak

IdelsTak commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Code notes:

https://github.com/IdelsTak/tray/blob/ad47caef8485e807f8fe107205001aadd9d7aff2/src/qz/ui/component/iconcache/Cache.java#L79

Each themed cache entry now owns its raster before mask coloring, so Light and Dark no longer mutate the same image

https://github.com/IdelsTak/tray/blob/ad47caef8485e807f8fe107205001aadd9d7aff2/test/qz/ui/component/IconCacheTests.java#L134

This checks ownership separately from the following pixel comparison across both tray masks and every declared size

@IdelsTak IdelsTak changed the title Fix tray cache and fallback lifecycle Fix themed tray cache isolation Oct 28, 2026
@IdelsTak

IdelsTak commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Wrapper correction:

SystemTray.isSupported() can’t be the final selection gate because actual tray loading or attachment may still fail

That means 8a6bbeb and its test encode the wrong contract and shouldn’t merge as-is

ad47cae is independent and remains the valid cache fix

I’m leaving the wrapper commit visible as requested and will revisit it after the intended macOS and Windows flow is clear

@IdelsTak

Copy link
Copy Markdown
Contributor Author

The cache repair is now integrated into #1538 as 18b6c03 with expanded mask coverage

Closing this contribution as superseded

The wrapper commit remains non-mergeable for the selection-contract reasons recorded above

@IdelsTak IdelsTak closed this Oct 29, 2026
@IdelsTak
IdelsTak deleted the pr-1538-tray-icon-cleanup-review branch October 29, 2026 05:22
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