fix(tooltips): keep dynamic tooltips from resetting hover delay - #5212
Merged
Conversation
Cache ALabel tooltip markup and provide it through query-tooltip instead of repeatedly setting GtkWidget's tooltip-markup property. This prevents frequently updating modules from restarting GTK's display-wide tooltip timer. Keep the active tooltip updated directly so dynamic tooltip contents continue refreshing while the pointer remains stationary.
Owner
|
Thanks! |
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.
Cache ALabel tooltip markup and provide it through query-tooltip instead of repeatedly setting GtkWidget's tooltip-markup property. This prevents frequently updating modules from restarting GTK's display-wide tooltip timer.
Keep the active tooltip updated directly so dynamic tooltip contents continue refreshing while the pointer remains stationary.
Problem
Setting
tooltip-markupqueues a display-wide GTK tooltip query. Amodule updating more frequently than GTK's hover delay continually
restarts that delay, preventing its own tooltip—and potentially other
modules' tooltips—from appearing.
Testing
Tested with a custom module updating its displayed text and tooltip every
250 ms, alongside a static control module.
Verified that:
from appearing.
Waybar configuration.
Related issues
Related to #4801, #4519, and #4842.
#4812 restored dynamic tooltip synchronization by repeatedly setting
tooltip-markup, but was reverted because doing so resets GTK's hoverstate. #4900 subsequently avoided redundant property assignments by
deduplicating identical markup.
That does not cover genuinely dynamic tooltip content: when the value
changes on every update, every assignment is non-redundant and GTK's
display-wide tooltip delay is still continually restarted. This change
provides tooltip content through
query-tooltipand updates an alreadyactive tooltip directly, preserving both initial display and live
updates.
Checklist
clang-formatninja -C build)changed