Shell background: setInstant flashes black until the new image decodes
System details
Dell XPS 13 (Intel Core 5 320), Omarchy 4.0.4, quickshell 0.3.1, Qt 6.11.2
What's wrong?
omarchy-shell background setInstant <path> blanks the desktop to black until the new image has decoded, so every instant switch to a large wallpaper flashes black. background set (the wiping transition) doesn't, because it keeps the old frame up until the new one is Ready.
In shell/plugins/background/Background.qml, the instant branch of transitionBackground() points displayedBackground straight at the new path. The base Image is asynchronous: true, so it drops the old picture and paints nothing until the new file decodes. Nothing sits behind it except the transparent panel, so the screen shows black for that time. For a 2560×1440 PNG of a few MB, that's a visible flash of 100 ms or more.
Steps to reproduce
- Put two large PNGs (a few MB each) in a theme's
backgrounds/. - Alternate between them with
omarchy-shell background setInstant /path/to/a.pngandomarchy-shell background setInstant /path/to/b.png. Calling it from a Hyprlandworkspace.activehandler, to give each workspace its own wallpaper, shows the flash on every workspace switch. - The desktop goes black briefly on each switch. Running the same steps with
background setgives no flash.
Suggested fix
Qt 6.8 added Image.retainWhileLoading, which keeps showing the current image until the new source is ready. One line on the base Image:
Image {
id: base
...
asynchronous: true
cache: true
retainWhileLoading: true
I checked this outside the shell with a minimal QML scene on Qt 6.11.2 (offscreen platform): an asynchronous Image swapping between two 2560×1440 PNGs, with frames grabbed while the second one loads.
- Without
retainWhileLoading, every grabbed frame was pure black (mean brightness 0 in all 6 samples). - With
retainWhileLoading: true, the frame still showed the previous image (mean brightness 51, the old wallpaper).
The transition path should be unaffected: it already keeps incomingBackground visible until base reports Ready.
Still present on quattro, but the code moved since 4.0.4. base is now a BackgroundMedia (shell/Ui/BackgroundMedia.qml, from #13408), whose inner Image is still asynchronous: true with no retainWhileLoading, so the one-liner still belongs there.
There's a second blank window on quattro, though. With constrainDecode, the image's source is "" until decodeSize(path) is known, and for a path not yet in nativeSizes that stays Qt.size(0, 0) until the size probe returns. retainWhileLoading keeps the old frame only while a new source is loading, not when the source is cleared. So an instant switch to a new, unprobed path would still blank first.
The wiping set avoids both because it waits for the incoming frame to be Ready. For setInstant, the robust fix is probably to keep the previous path displayed until the new one's native size is known (the prepare path already probes it) and to add retainWhileLoading: true to the image.
Checked against quattro (0c93f614): the bug is still there, and it has the two gaps described above. setInstant points displayedBackground at the new path straight away (shell/plugins/background/Background.qml:127). On an instant switch reloadVersion changes too, so the image URL changes even when the path stays the same. First, BackgroundMedia sets the image's source to "" until the wallpaper's size probe returns (shell/Ui/BackgroundMedia.qml:41). Then the asynchronous Image, which has no retainWhileLoading, shows nothing while the file decodes. The panel is transparent and nothing draws behind it, so the screen is black for both gaps.
#14084 fixes this, and it closes this issue when it merges. It waits to change the path and the version until the new wallpaper's size is known, and it turns on retainWhileLoading for the desktop only, so the lock screen is unchanged. It was reviewed separately and run on a disposable Omarchy worker. On quattro, sampling the screen during instant switches between two 7680x4320 PNGs showed black every time. On the branch it showed the old wallpaper until the new one replaced it. The suite and the background shell tests passed there. #14161 tried the same fix and was closed in favour of #14084.
Diagnosis checked by Claude Opus 5.5, with a second opinion from Codex Medium. Codex reached the same conclusion from the source but could not fetch the pull request's diff this time, and it can read my working notes, so its agreement is not independent. One case neither change covers: a size probe that never exits would leave an instant switch waiting, just as it leaves the image blank on quattro today.
This is waiting on the maintainer to decide on #14084.
Another data point on 4.5.0-3 (Hyprland, NVIDIA RTX 2060 Super, 615.78.08 open module, a 3840x2160 monitor at scale 1.875 next to a 1920x1080 one at 1.0). The thread says the wiping set avoids both blank gaps, but here it also visibly flickers. A script that calls omarchy-theme-bg-set every 5 minutes, alternating between two nearly identical 3840x2160 PNGs (wall-a.png/wall-b.png), flickered on every run, reproducibly when run by hand. It started right after the upgrade from 4.0.6. Running omarchy-shell background setInstant on the same files flashed as bad or worse, which matches what's described here. I haven't worked out why the wiping path flickers.
Thanks, this separates two behaviors. omarchy-theme-bg-set calls the non-instant background set, so the reproducible flicker there is outside #14064 and #14084; that PR only keeps the old frame through setInstant's probe and decode. The wiping path already waits for the incoming media to be ready.
Could you open a separate issue for the wiping-path regression and include a short capture, plus whether the bad frame is black or an abrupt old/new-image swap? The 4.0.6 to 4.5.0-3 boundary, NVIDIA driver, mixed scales, and exact alternating command you gave are useful reproduction details. This report should stay linked here, but #14084 should not be treated as covering it.
The wiping flicker reported above is now tracked in #17864, including a capture. The earlier comparison with wiping background set does not rule out that later report on different hardware and a later release. #14084 addresses the original instant-switch probe and decode gaps; it has not been verified as a fix for #17864.
This pass checked the new comments, #17864, current quattro (419a5a709) and #14084 (e2f86cc9) by reading the source and diff. No tests were rerun. Codex High reviewed this with Opus 5.5 High and muse-wonder via pi, thinking high. Both reviewers agreed that the original instant-switch defect remains in the source and that #14084 addresses its two gaps. Their independence is not guaranteed.
This issue remains waiting on the maintainer's decision on #14084. Follow-up evidence about the wiping flicker belongs in #17864.