Surface Wallpaper Engine project type in the UI#278
Conversation
caa6dd4 to
6f036e5
Compare
|
Updated this branch after the module-boundary cleanup from the neighboring PRs, and clarified the GTK grid layout detail added by the visible labels. What changed: moved Wallpaper Engine metadata helpers out of common.py added a small standalone waypaper/wallpaperengine.py module for preview discovery, project.json normalization, and type-aware UI labels updated app.py so the GTK grid consumes Wallpaper Engine labels from that dedicated module added unit tests for metadata normalization, label formatting, preview discovery, and bad-metadata fallback documented the + 34 row-height padding in app.py The + 34 is there because this PR changes each grid item from image-only to image + visible wrapped label. The extra row height reserves the vertical label footprint: 6px from the Gtk.Box spacing plus roughly one wrapped text row. That prevents later rows from overlapping or truncating labels when GTK reflows the grid during window resizing. This is especially easy to trigger under tiling compositors such as Niri, Hyprland, or Sway, but it is the same GTK layout issue under any live resize. The metadata fallback is also intentional: if a Workshop project's project.json is missing or malformed, the grid falls back to the project directory name instead of failing while rendering thumbnails. Additionally, layout stability has been fully validated across complex multi-monitor environments, supporting both vertical and horizontal display alignments seamlessly. This keeps #278 independent from #279 while still following the same module boundary. If #279 or #280 lands first, the shared module can be reconciled by a normal rebase. Validation after the update: |
6f036e5 to
23bb4b9
Compare
|
My main issue is that this creates a label with a name, regardless of the backend. Typically we don't have labels on thumbnails by design, just to keep a minimal look. Are these labels somehow necessary on this backend? I know that the name in the tooltip is meaningless number, but even if so, it should not affect the other backends, but ideally, it would be great if the app.py part would not be touched without real necessity. |
Drop the visible thumbnail label proposed in anufrievroman#278. The picker stays minimal and the app.py GTK layout is unchanged from main. What this branch does instead: - waypaper/wallpaperengine.py: small internal module for project.json normalization (project dir, type/title with normalization, entry file for video projects, title [type] string for the tooltip). - waypaper/common.py: get_image_name now detects Workshop paths by the presence of a sibling project.json and surfaces the normalized 'Title [type]' in the existing tooltip. The same module name anufrievroman#280 uses, so the two branches share the metadata surface without re-implementing the helpers. - waypaper/app.py: 0 lines changed from main. The grid is image-only with the type tag living in the existing set_tooltip_text(name) call. - tests/test_wallpaperengine.py: tests for the metadata helpers, the type-aware label string, and the get_image_name fallback when project.json is missing or malformed. Net effect for the user: hovering a Workshop thumbnail in the picker shows 'Neon Driver [scene]' / 'Title [web]' instead of the raw Steam Workshop numeric ID. No GTK layout change, no visible label.
23bb4b9 to
feae114
Compare
|
Fair point, and you're right — the visible label is gratuitous for the The shape I'm going to push on this branch:
Net diff for
I'll push the reduced branch shortly and ping back with the diff |
Drop the silent video-backend rerouting proposed in anufrievroman#280. The user's selected backend in the picker is always honored. What stays in this branch: - waypaper/wallpaperengine.py: small internal module for project.json normalization (project dir, type/title, entry file). Same module name anufrievroman#278 uses, so the two branches share the metadata surface without re-implementing the helpers. - waypaper/changer.py: cleanup_dynamic_backends(monitor, exclude=...) before each change_with_* call, and find_process_pids that returns all matching PIDs (the old find_process_pid only returned the first match, which could leave a second mpvpaper -f socket-... alive on a multi-monitor switch). - Informational advisory: when the WE path detects a video project under linux-wallpaperengine, print a one-line note about the well-known CPU/battery tradeoff. Gated by cf.we_video_advisory (default True). The note never overrides the user's choice. - Tests for the metadata helpers and the new PID-helper behavior. This is not a behavior change for the image backends. The advisory is the only observable difference from main when the user is on a non-WE backend or a non-video project.
I use the wallpaperengine app on windows. I don't know what they are too. |
|
Regarding your question about necessity: The labels were indeed too intrusive, hence why I moved them to the tooltip. About the 'why': Moving from Wallpaper Engine on Windows to Linux (specifically tiling managers like Niri/Hyprland), I noticed that the way these assets are handled is fundamentally different. On Windows, the engine self-adjusts based on the asset type (Scene, Video, Web), but in Linux, we are often forced to run them through compatibility layers or specialized backends. This metadata normalization is not just about UI labels; it is about establishing a stable data contract for Wallpaper Engine items within Waypaper. Without this in By normalizing this metadata here, we move the 'brittleness' of Workshop projects into one tested, internal module. It turns Waypaper into a more robust tool that understands what it is running, rather than just treating everything as a generic image path. The tooltip is just the first consumer of this data, but it essentially future-proofs the codebase for better backend integration. In this way, and with other follow-ups hardenings on my edge, i been capable of fluent performance, ofc if other layer are above this in a better set up its great, but on the Penguin could be useful for debugging and actual compatibility on some edge cases/distros/way that the OS manage windows different than in Windows itself. |
|
Thank you for the changes, sorry I didn't have time yet to review everything again, I'll try to find time soon |
Closes #275
Summary
Normalize Wallpaper Engine metadata from
project.jsonand surface the detected project type directly in the UI soscene,video, andwebentries stop looking like generic static previews.Architecture
This PR is standalone on top of
main; it does not require #279 to be merged first.To keep Wallpaper Engine-specific metadata out of the generic file/image helpers, this PR adds a small
waypaper/wallpaperengine.pymodule for the UI metadata slice:project.jsonloading andtype/titlenormalizationTitle [scene],Title [video], andTitle [web]waypaper/common.pyremains focused on generic file/image operations, andwaypaper/app.pyimports the Wallpaper Engine label helpers from the dedicated module.If #279 or #280 lands first, the shared
wallpaperengine.pymodule boundary can be reconciled through a normal rebase. This PR remains reviewable as the narrow UI metadata slice.Scope Boundary
Validation
python3 -m py_compile waypaper/app.py waypaper/common.py waypaper/wallpaperengine.py tests/test_wallpaperengine.pypython3 -m unittest discover -s testsgit diff --check origin/main...HEADCurrent result: 17 tests pass.