Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix notification image reloading #3883

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Elv13
Copy link
Member

@Elv13 Elv13 commented Dec 31, 2023

It might work. I ran the code, but I don't have "real" tests for this right now.

This *should* allow to reload images when the path has not changed.
I only did limited testing (aka, it doesn't crash and detect changes).

See awesomeWM#2851
Copy link

codecov bot commented Dec 31, 2023

Codecov Report

Attention: 16 lines in your changes are missing coverage. Please review.

Comparison is base (cb72c0a) 91.01% compared to head (98a8922) 90.99%.
Report is 18 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3883      +/-   ##
==========================================
- Coverage   91.01%   90.99%   -0.02%     
==========================================
  Files         901      902       +1     
  Lines       57566    57744     +178     
==========================================
+ Hits        52392    52545     +153     
- Misses       5174     5199      +25     
Flag Coverage Δ
gcov 90.99% <57.89%> (-0.02%) ⬇️
luacov 93.70% <57.89%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
lib/naughty/list/actions.lua 94.50% <ø> (ø)
lib/naughty/widget/icon.lua 92.40% <88.88%> (+0.09%) ⬆️
lib/wibox/widget/imagebox.lua 90.80% <48.27%> (-5.63%) ⬇️

... and 7 files with indirect coverage changes

Comment on lines +345 to +346
-- @tparam[opt=false] boolean args.force Reload the image even if the path has
-- not changed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it makes sense to implement this force parameter for all values of image. For anything but a path, there will be no change, and the resulting signals would be misleading ("emitted when the image changes").
Given that this is about being able to load from a path uncached, just make it explicit:

Suggested change
-- @tparam[opt=false] boolean args.force Reload the image even if the path has
-- not changed.
-- @tparam[opt=false] boolean args.uncached Bypass the cache when loading the image.

Either way, you're currently still not bypassing rsvg_handle_cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants