Skip to content

fix(tooltips): only update the tooltip of the hovered module - #5245

Open
rmrfus wants to merge 1 commit into
Alexays:masterfrom
rmrfus:tooltip-hover-gate
Open

fix(tooltips): only update the tooltip of the hovered module#5245
rmrfus wants to merge 1 commit into
Alexays:masterfrom
rmrfus:tooltip-hover-gate

Conversation

@rmrfus

@rmrfus rmrfus commented Aug 12, 2026

Copy link
Copy Markdown

Since #5212 every module pokes active_tooltip_->set_markup() on update. That reference is cleared on leave-notify, which is not always delivered when the pointer moves between adjacent modules, so a fast-updating module overwrites the tooltip of whichever module is actually hovered.

Check the pointer position instead of trusting leave-notify.

What does this PR do?

Hovering one module sometimes flashes a neighbor's tooltip contents. With a lot of custom modules with interval: 1 this creates a significant problem. active_tooltip_ is only cleared on leave-notify, which is not always delivered when the pointer moves between adjacent modules, so a fast-updating module overwrites the tooltip of whichever module is actually hovered.

This gates the update on the live pointer position instead of trusting leave-notify, and drops the stale reference when the pointer is elsewhere.

Tested for several days on NixOS 26.05 and Fedora 43 (both on sway 1.12) with a several custom modules with interval: 1.

Related issues

No issue filed. The behavior was introduced by #5212.

Checklist

  • Code is formatted with clang-format
  • Builds locally (ninja -C build)
  • Man page updated for any new/changed user-facing option (man/) - n/a. No new options
  • Tested against the affected module(s)

Since Alexays#5212 every module pokes active_tooltip_->set_markup() on update.
That reference is cleared on leave-notify, which is not always delivered
when the pointer moves between adjacent modules, so a fast-updating
module overwrites the tooltip of whichever module is actually hovered.

Check the pointer position instead of trusting leave-notify.
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.

1 participant