Skip to content

Fix notification image reloading#3883

Open
Elv13 wants to merge 3 commits intoawesomeWM:masterfrom
Elv13:2023_xmas_commits_pr3
Open

Fix notification image reloading#3883
Elv13 wants to merge 3 commits intoawesomeWM:masterfrom
Elv13:2023_xmas_commits_pr3

Conversation

@Elv13
Copy link
Copy Markdown
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
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 31, 2023

Codecov Report

❌ Patch coverage is 57.89474% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.99%. Comparing base (cb72c0a) to head (98a8922).
⚠️ Report is 115 commits behind head on master.

Files with missing lines Patch % Lines
lib/wibox/widget/imagebox.lua 48.27% 15 Missing ⚠️
lib/naughty/widget/icon.lua 88.88% 1 Missing ⚠️
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 with missing lines 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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines +345 to +346
-- @tparam[opt=false] boolean args.force Reload the image even if the path has
-- not changed.
Copy link
Copy Markdown
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.

2 participants