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.
These two commits resolve #26, by always submitting opaque buffers. This is done by painting the buffers submitted with a uniform color, before drawing the image on top. The default color is chosen to match Sway's default background color, so that most people invoking swaybg under Sway with a semi-transparent (or badly sized
fit
orcenter
mode image) will see the same result as before.I've been undecided about this change for a while, since there is an alternative which preserves the current behavior; to detect when the output image may be semi-transparent, as a function of the scaling mode, the image size, the presence of the
--color
flag, and whether the image has an alpha channel. However, I don't think allowing transparency in edge cases is a good behavior for a wallpaper program to have, and solving #26 while keeping the current behavior makes the buffer creation logic more complicated, making changes like submitting 10-bit buffers -- for which Cairo only supports the opaque RGB30 format -- harder to implement.