Repository navigation
wallpaper: hide wallpapers that don't fit the display - #4288
Conversation
A new toggle on Wallpaper & colors, shown once a wallpaper folder is added, limits Super+Y, the desktop menu strip, Next/Previous and automatic cycling to wallpapers that fit the display they are for: an aspect ratio within 1.5x of the display's and at most 1.5x upscaling, in physical pixels. In per-display mode each display is judged on its own; with one shared wallpaper the display with the most pixels decides. SVGs and files of unknown size always pass. wallpaper.list takes a dimensions flag and only then reads sizes: image headers through image.DecodeConfig, and ffprobe (when installed) for video, AVIF, HEIF, JXL and EXR, with the canvas of tiled HEIF/AVIF and display rotation taken into account. Reads are bounded (4 at once, 5 s and 64 KB per ffprobe run) and cached on path, size and mtime. Without the flag the response is unchanged. API version 43. Picking a KDE wallpaper package in Super+Y or the desktop menu now applies its size closest to the display's shape, as cycling already did.
Claude reviewLooks good, with one compatibility issue for older ffprobe.
|
ffprobe fails the whole call on an unknown -show_entries section. stream_group_component came with FFmpeg 7.0 and stream_group_side_data only with 9.0, so on older versions every probe exited 1 and videos, AVIF and HEIF were cached as unknown size even with ffprobe installed. Check `ffprobe -sections` once per binary and only request the group entries it lists. A failed check leaves the size unknown without caching it. Claude-Session: https://claude.ai/code/session_01DQu2E3ZSRt9kas4CzM8kfP
Claude reviewNo issues found. The new commit fixes the earlier ffprobe < 7.0 finding: it checks |
# Conflicts: # quickshell/Common/settings/ConfigProfiles.js # quickshell/Widgets/WallpaperThumbTile.qml
Master took 43 for global shortcuts.
Master moved the profiles card into a SettingsDeferred, and the merge left the toggle inside it as a second child.
Claude reviewNo issues found. The new commits merge master, bump the API version to 44, and move the fit toggle back into the Wallpaper card after the merge left it in the profiles card. |
Description
Builds on the folders PR in #4155, in preparation for display groups and per-display slideshows.
This adds a "Hide wallpapers that don't fit the display" toggle to Wallpaper & colors. With it on, Super+Y, the desktop right-click menu, Next/Previous and automatic cycling only offer wallpapers that fit the display they are meant for. The rule is fixed for now: the aspect ratio has to be within 1.5x of the display's and the image can't need more than 1.5x upscaling. That leaves some room, and the fill mode decides how those slightly off images are shown.
Respects the individual display if they show separate wallpapers, with one shared wallpaper the display with the highest resolution decides.
The folder page in Settings still shows everything, with the wallpapers that don't fit dimmed and marked with the hidden icon and their size. You can still pick them from there if wanted.
Without any wallpaper folder the toggle is hidden and nothing is filtered, since the image sizes come with the folder list. They are only read while the toggle is on. SVGs always show up, and so do video, AVIF, HEIF, JXL and EXR files when ffprobe isn't installed, since their size is unknown then.
Also, picking a KDE wallpaper package in Super+Y or the desktop menu now uses the size that matches the display's shape, the same way automatic cycling already did, instead of always the largest one.
Type of change
Related issues
Screenshots / video
Checklist
I18n.tr()with translator context, reusing existing terms where possiblemake fmt, added/updated tests,make testpasses, andgo mod tidyis cleanmake lint-qmlwith no new warnings