-
Notifications
You must be signed in to change notification settings - Fork 5
update tray menu before sending MenuDiff event #21
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
base: master
Are you sure you want to change the base?
update tray menu before sending MenuDiff event #21
Conversation
Now also updating StatusNotifierItem on properties update. |
Thanks for this. Re-fetching the entire menu isn't supposed to be necessary when fetching a single property, but it does not shock me at all that there are implementations bad enough to make it necessary. This does effectively duplicate the layout updated case above - if we're re-fetching the layout in both, could you look to see if you could condense them down please? |
I used this as a quick fix to make my project work, cause I didn't bother creating my own implementation of this map. I agree that it should be rewritten and ideally we should update only the changed properties in TrayMenu and StatusNotifierItem. I may have some time to try tackling this problem, but I should warn you that I am very new to Rust, so it's better to double-check my code and possibly direct me with finding out solution. For this specific case I guess I'll need to create a function to apply vector of MenuDiffs to the actual menu and similarly for the status notifier item. |
1f342b4
to
e56dfd6
Compare
Seems to work. Now it doesn't re-fetch entire menu but applies the updates to the existing ones in items map. |
162a03f
to
b71553b
Compare
Let me know what you think and what changes should be applied. I also wonder why there is no methods implemented on the actual structures such as TrayMenu or MenuItem to feed updates/diffs for them to change. I think it would be beneficial to have those, in case of disabled "data" feature as well. Or maybe I missed something and my implementations to apply updates to the structures is redundant or inefficient? |
fixed #20 for me