ui: add span fit_mode to split one image across outputs - #373
Open
josephdunn wants to merge 1 commit into
Open
Conversation
span slices a single wallpaper across every output it is assigned to, so the picture is continuous across the physical monitor arrangement instead of repeating the whole image on each output. Outputs sharing a wallpaper entry form a span group. The image is mapped onto the group's bounding box in Hyprland's logical layout coordinates, and each output shows the sub-rectangle its layout rect covers. Placement within that canvas is chosen with an optional sub-mode: span / span:cover (default), span:contain, span:stretch. The layout is read from Hyprland over its IPC socket; when it is unavailable (not under Hyprland, or an output's geometry can't be resolved) each output falls back to cover. A group of one output is equivalent to the matching plain mode. Slices are rendered with cairo and cached as PNGs under $XDG_RUNTIME_DIR. Adds cairo, hyprgraphics, libpng and jsoncpp to the build dependencies.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
fit_mode = span, which splits a single wallpaper across every output itis assigned to so the image is continuous across the physical monitor
arrangement, instead of repeating the whole image on each output (which is what
cover/contain/fill/tiledo today).Optional sub-modes control how the source is fit onto the combined canvas:
span/span:cover(default) — fill the canvas, crop overflowspan:contain— fit the whole image, letterboxspan:stretch— stretch to the canvas aspectExample
How it works
wallpaperentry form a span group.j/monitors).coordinates (so mixed-DPI monitors stay continuous in physical size), and
each output is handed the sub-rectangle its layout rect covers.
$XDG_RUNTIME_DIR.Fallback
If the layout can't be read (not under Hyprland, or an output's geometry can't
be resolved), each output falls back to
coverwith a warning.Dependencies
Adds
cairo,hyprgraphics,libpng, andjsoncpp(CMake + nix).cairo/hyprgraphicswere already transitively present via hyprtoolkit;libpngandjsoncppare new.Testing
geometrically contiguous across seams, and mixed-height/DPI monitors sample
the correct region.
span:covercropping, the single-output degenerate case, and theno-Hyprland cover fallback.
Known limitations
an unplug) doesn't re-slice until the wallpaper is re-set — hyprtoolkit
exposes no "output changed" signal. Hotplug (add/remove) is handled.
are untested.
spanis config-file only; the IPC/hyprctlfit-mode enum isn't extended(that would be a protocol change).