Repository navigation
Keep the transparent bar's text colour in step with theme switches - #14148
dt-lindberg wants to merge 3 commits into
Conversation
[Medium impact] The PR appears safe to merge; no new actionable issues were found. SummaryKeeps transparent bar text in step with theme and wallpaper changes.
No new actionable issues were found. Runtime and visual checks were not performed during this review.
|
|
For reviewers: #13914 (Oct 1) also fixes the dropped transparent-bar sample by queueing a rerun when a request lands mid-sample and discarding the stale answer. This PR does that and also adds |
|
I read this against current Two things for whoever picks this up next. First, the branch no longer merges cleanly into |
The bar watched ~/.local/state/omarchy/current, which fires when omarchy-theme-set starts staging, before the new colors or wallpaper reach the shell. That sample ran with the previous theme's colors, and the request the new palette made while it ran was dropped, so the bar kept the previous theme's text color. The background plugin now exposes appliedBackground, moved in the same step as a theme's colors, and the bar samples against it. A request made while a sample runs is rerun when that sample exits. Without a background plugin that exposes appliedBackground, such as one cloned before this change, the bar still re-samples on state directory changes.
A process's output can arrive after its exit signal, so clearing the block on exit could briefly apply the outdated answer before the replacement sample ran.
The assertions matched onExited only as a one-line handler, so an equivalent block-bodied handler failed them, and one that cleared the block on a later line passed.
61ebdf0 to
2808d7c
Compare
|
I reviewed this again at 2808d7c, which now merges cleanly into #13914 is older and fixes the same cause in a different way. When a new request arrives, it invalidates the running sample through a request serial, and it retries after that sample exits. I compared the two by reading the source, and asked Codex Medium the same question without giving it my answer. We both concluded that #13914 should be the one to land: nothing in it misses a case this PR handles. In #13914, a sample started before What this PR adds on top of #13914 is efficiency: one sample per theme switch, against the applied wallpaper, where #13914 needs a rerun or two. That makes no visible difference, since #13914 already discards every stale answer. It also touches Nothing ran on a worker: verifying a fix that is not the one going forward would spend a worker for nothing. Which fix lands is the maintainer's decision, and this PR waits on it. |
Fixes #10289. Independent of #14220, but the two conflict in
Bar.qml, so I'll rebase whichever lands second.With a transparent bar, switching theme can leave the bar with the previous theme's text colour. Switching Gruvbox → Rose Pine → Gruvbox, with a few seconds on Rose Pine, leaves Rose Pine's dark purple text on Gruvbox's dark wallpaper. The first switch goes wrong too, less visibly: Gruvbox's light text on Rose Pine's light wallpaper.
Toggling transparency off and on fixes it until the next theme switch.
Screenshots
Same slow round trip (Gruvbox → Rose Pine, wait 5 s → Gruvbox), bar at the top.
Before
Rose Pine, with Gruvbox's light text left over:

Back on Gruvbox, with Rose Pine's purple text left over:

After
Rose Pine:

Gruvbox:

Cause
Bar.qmlaskedomarchy-bar-text-colorfor a new colour from two places:FileViewon~/.local/state/omarchy/current. It fires as soon asomarchy-theme-setcreates itsnext-themestaging folder there, before the new palette or wallpaper reach the shell. That sample runs with the previous theme's colours and wallpaper.onThemeForegroundChangedand friends), which fire when the background plugin applies the new palette at the start of the reveal.The script takes about 0.4–0.7 s. When (2) lands while (1) is still running,
refreshTransparentForeground()returns early because the process is busy, and nothing retries. The stale answer from (1) then sticks.Whether (2) lands inside that window depends on load, which is why it shows up after staying on a theme for a few seconds but not on a quick round trip. A log of each sample's arguments shows it directly:
Fix
Background.qmlexposesappliedBackground: the wallpaper that goes with the palette on screen. A plain wallpaper change sets it straight away; a theme switch sets it insideapplyPendingTheme(), in the same step as the new colours.Bar.qmlsamples whenappliedBackgroundchanges, passing it as--background, so the script samples the wallpaper the shell is showing rather than whatever the link points at mid-switch. The colour watchers stay; on a theme switch they fire in the same step asappliedBackground, so the 120 ms timer folds them into one sample.FileViewnow only acts when the background plugin has noappliedBackground: no background plugin, or one cloned before this change. Those setups keep re-sampling on wallpaper-only changes as before, and the rerun above still corrects the early sample on a theme switch.Testing
New source checks in
test/shell.d/bar-test.shandtest/shell.d/background-test.sh. Both fail without the change and pass with it.Live, with this change applied to the installed 4.0.4 shell (plus the
servicesproperty fromquattro'sshell.qml, which 4.0.4 lacks) and every sample logged:omarchy theme bg nextbg next0.25 s apartleft 28)Background.qml(simulated pre-change clone), round trip +bg next./test/all: the remaining failures are unrelated. They fail the same way onquattroor need a localomarchy-pkgscheckout.System
quattroat 393a43d)🤖 Generated with Claude Code