Skip to content

Decode wallpapers at the size the screen can show - #9417

Closed
VykosMolt wants to merge 1 commit into
omacom:quattrofrom
VykosMolt:fix/wallpaper-decode-size
Closed

VykosMolt wants to merge 1 commit into
omacom:quattrofrom
VykosMolt:fix/wallpaper-decode-size

Conversation

@VykosMolt

@VykosMolt VykosMolt commented Aug 31, 2026 •

Copy link
Copy Markdown

Desktop still wallpapers and their transition frames decode at native file resolution, even when the display can show much less. Their sourceSize is now capped at 1.6 times the screen dimensions, including Screen.devicePixelRatio, and both transition frames share the base wallpaper's decode size. The extra room accommodates aspect cropping without immediately scaling wide images back up.

The desktop now renders its base wallpaper through BackgroundMedia, so that component exposes a sourceSize property and forwards it to its still-image loader. Its default retains the existing lock-screen sizing behavior. Video playback, audio selection, and pause conditions continue to use the existing video path.

background-test.sh and video-background-test.sh pass, including checks for shared transition sizing, the media component's default sizing, and preserved video behavior. git diff --check passes. Rebased onto current quattro; live graphical verification has not been repeated for this revision.

The three `Image` elements in `Background.qml` set no `sourceSize`, so each one
decodes its wallpaper at the file's native resolution and keeps it that way for
as long as the background is up. A decoded image is uncompressed regardless of
how small the file on disk is: `retro-82/5-zen-boat.webp` is 10456x3455, which
is 138MB of RGBA held for a 2560x1600 screen that can show 16MB of it. 37 of the
92 wallpapers shipped in `themes/` are larger than the screens they are drawn
on, and the two transition frames carry `mipmap: true`, which asks for another
third on top of whatever was decoded.

Each `Image` now caps `sourceSize`, so the decoder scales the image down as it
reads it and the oversized buffer is never allocated. `oldFrame` and
`incomingFrame` take their size from `base` so the three frames of a cross-fade
always agree.

The cap is 1.6x the screen rather than exactly the screen because setting both
`sourceSize` dimensions makes Qt fit the image inside that box while preserving
aspect. A box exactly the size of the screen would decode a 2.39:1 wallpaper too
short to cover a 16:10 display, and `PreserveAspectCrop` would scale it back up
to fill, which is the blur this is meant to avoid. 1.6x covers every aspect ratio
up to 1.6 times the screen's own and still leaves the largest wallpapers well
under their native size.

The multiplier is the attached `Screen.devicePixelRatio`, matching `Menu.qml`,
`Tray.qml` and `NotificationCard.qml`. `parent.screen` is not an option here: a
child declared inside a `PanelWindow` is reparented to the window's
`contentItem`, and a `QQuickItem` has no `screen` property, so reading it would
silently yield `undefined` and decode every wallpaper at 1x.
@VykosMolt
VykosMolt force-pushed the fix/wallpaper-decode-size branch from 7a5c6fb to 240d7f6 Compare September 8, 2026 21:25
@bjarneo

bjarneo commented Sep 21, 2026

Copy link
Copy Markdown
Member

Automated duplication check: this pull request looks similar to #8324, which covers the same wallpaper decode size cap. I keep that one open and close this one to consolidate review.

If you feel this is the wrong decision, please open the PR again with a note on the difference.

@bjarneo bjarneo closed this Sep 21, 2026
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.

2 participants