core: migrate to Hyprutils::CAsyncResourceGatherer and improve resource handling#879
Merged
PointerDilemma merged 19 commits intohyprwm:mainfrom Oct 8, 2025
Merged
Conversation
Collaborator
Author
|
There it is. Currently still testing it too. |
Member
|
in general looks fine, just needs testing |
use a simple counter instead of a timestamp to allow the same widget on a different monitor to reuse a text cmd resource. I didn't do this before, because I was worried about two labels that use the same command with different reload times. I mitigated that by just incrementing the revision by the time interval. This should be sufficent to avoid clashes.
another much improvement for multi monitor setups. allows updating within the same frame for most labels.
I tested and it seems like the resource manager revision makes the nvidia workaround obsolete.
4390237 to
2eef5d4
Compare
Collaborator
Author
|
I tested this on the nvidia machine yesterday and the PR seems to have made this dump workaround we had obsolete. Also checked asan and ubsan and tested all the widgets. Some of this code might be changed soon again, when trying to use some of hyprtoolkits implementations. It should improve idle time quite a bit and reduce rendered assets especially when using multiple monitors. |
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.
This PR utilizes
Hyprutils::CAsyncResourceGatherer(hyprwm/hyprgraphics#36) and adds some hyprlock specific stuff on top.Because of this rewrite I decided to make two significant changes concerning the interface between the gatherer and the widgets:
Resource ids and avoiding duplicate resources
Resource ids are not strings anymore, but instead they are a hash of what was requested.
Before the caller (usually widgets) had to come up with a unique string. Now the resource id is returned when requesting a resource.
Together with the fact that the resources now have a ref count, we avoid having duplicate resources in the resource manager. This is nice to have because when
monitor=""there is one widget per monitor that needs the same resource.onAssetUpdatevirtual method for widgetsBefore we had to capture a weak reference to a widget in a lambda to safely call the asset callbacks.
Now we don't store a lambda as a callback, but only the weak widget reference. When the resource is finished, we call the virtual
onAssetUpdatemethod on it.This is implemented using a vector to allow for multiple widget callbacks for a single resource.