Re-render CImageElements on fitMode change#96
Merged
Conversation
the cached texture bakes in the fit mode, but the cache key was just the path (plus the svg/icon size), so two image elements sharing a path with different fit modes collided on one cache entry and the second drew with the first's fit. shows up with hyprpaper putting one image on two monitors with different fit_mode. this keys on the fit mode instead of guarding the cache hit, so get() returns the right entry and the in-flight dedup for elements sharing path and fit mode stays. the original if (ASSET) path is restored. adds a unit test.
Contributor
|
@Vruk11 your repro found this. pushed a cache-key version to |
Contributor
Author
|
@UncleJ4ck Thank you, merged your branch as suggested. |
vaxerski
approved these changes
Jun 23, 2026
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.
When calling to set a Hyprpaper wallpaper with Hyprctl using the same image path but a different
fit_modevalue for two monitors one after the other, it eventually fails because of a lack of a check inCImageElementfor cached assets.This PR attempts to fix that by simply comparing the
fitModevalues to decide if the asset should be reused or instead rerendered.I'm sorry if this is not correct fully, the correct solution to the overall problem, or up to a standard for this library since I don't know it well at all.