-
-
Notifications
You must be signed in to change notification settings - Fork 689
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
tray module enhancements #1145
tray module enhancements #1145
Conversation
cf97482
to
8cbf722
Compare
8cbf722
to
3623811
Compare
3623811
to
58b511a
Compare
@12101111, do you mind checking if the CPU usage is acceptable with this PR? |
// TODO: tooltip | ||
tooltip = get_variant<ToolTip>(value); | ||
if (!tooltip.text.empty()) { | ||
event_box.set_tooltip_markup(tooltip.text); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
static const std::map<std::string_view, std::set<std::string_view>> signal2props = { | ||
{"NewTitle", {"Title"}}, | ||
{"NewIcon", {"IconName", "IconPixmap"}}, | ||
// {"NewAttentionIcon", {"AttentionIconName", "AttentionIconPixmap", "AttentionMovieName"}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need of these mappings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented mappings are things we don't support at the moment. I.e. no reason to process AttentionIconPixmap updates if we aren't capable of displaying it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok got it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from some questions, LGTM
Thanks!
Comparing two GVariants is too expensive; let's collect the set of properties updated by each signal and apply them unconditionally.
On the `Passive` value of `Status` tray items would be hidden unless `show-passive-items` is set to true. On the `NeedsAttention` value of `Status` tray items will have a `.needs-attention` CSS class.
58b511a
to
a5fe6f4
Compare
Sorry for the late, the CPU usage is nearly to 0 and perf result looks great. |
The issue that prompted #1150 was I have waybar autostarted but even if disable autostart and start waybar for the first time at a later time, the tray icon is incorrectly showing until I kill the instance and start another. I am on latest version 0.9.8. |
@rieje can you please check |
Ok, just did some quick testing and I was wrong--it happens randomly all the time. I run multiple waybars to see what happens (the status is |
I believe it's not so random. I managed to reproduce the issue, and everything is right from our side: we're calling Do you happen to notice if the issue is reproducible when udiskie is not the first icon in the tray? My suspicion is that the first item in a GtkBox cannot be hidden, but I'll need to check GTK sources to confirm that. |
Yes, still happens if not the first (leftmost) icon. I see it as the second icon, and less frequently as the third (last) icon. |
So I got some time to debug the issue and found that it's our fault. I just never looked at the code dealing with updates on the whole tray module level and missed the right (or wrong in this case) line. @rieje do you mind giving alebastr@dc67bcc a try? Worked for me, but I only did limited testing. |
This works, I have not experienced any unexpected results at all. Looks fixed! |
Assorted enhancements for tray module.
I had to drop the tooltip icon changes with intent to finish those later, once I have a complete grasp of a possible implementation.
Need to take another look at
update_pending_
for possibility of races. Shouldn't be a blocker for the merge though, as I haven't found anything harmful so far. Only a minuscule chance of missing a property update.Changes:
Scroll
SNI method.Status
property: hidePassive
items by default; attach corresponding CSS classes to the icon.Fixes #1138, #1150