Skip to content

A cancelled hover can still show a tooltip or close its popup when the Mac is busy #482

Closed

Description

@M4n0x

What happens

Moving into a hover popup should cancel what the pointer left behind: the tooltip of a neighbouring widget it crossed on the way, and the popup's own close delay. When the main thread is busy at the moment one of those waits runs out, the cancel comes too late. The neighbour's tooltip still replaces the popup, or the popup closes although the pointer came back into it.

On CI it fails hoverTriangleProtectsDiagonalMovementUntilThePointerEntersStopsOrLeaves(replace: true, finish: "enter") at PresentationIntegrationTests.swift:254 (presentations.count → 2) and :257: 4 times, twice since 2026-11-01, including the push to main in run 41020019966. Those runs spent 35–55 seconds in that test, a sign of a very busy main actor.

Steps to reproduce

In the app it takes a main thread busy for more than 200 ms at the wrong moment, so it should be rare. In a test it happens every time:

  1. Start a hover wait: cross a neighbouring widget on the way to an open hover popup, or leave the popup so its close delay starts.
  2. Keep the main actor busy for longer than the 200 ms wait.
  3. Move into the popup, which cancels the wait.
  4. The cancelled task still shows the neighbour's tooltip, or closes the popup.

Expected

Entering the popup always cancels the pending tooltip or close.

Environment

CI (macos-26, Xcode 26.6) under load; locally on macOS 27.2 (Xcode 27.2) by holding the main actor.

Diagnosis

WidgetPopup.hover(_:store:anchor:show:) and closeAfterHover() (Sources/StableBar/WidgetPopup.swift) act after Task.sleep and waitForHoverPath(). A cancel interrupts a sleep that is still waiting, but not one that already ran out and whose continuation waits behind a busy main actor. That continuation resumes, waitForHoverPath() returns normally because the pointer has stopped, and show() or close() runs. Nothing checks for cancellation after the waits, although hover's documentation says that leaving the widget or closing the popup cancels the show.

Related

Triaged by Claude Code (Claude Opus 5.5).

Activity

  1. added
    bug
    on Nov 8, 2026
  2. stablebar-releases commented on Nov 10, 2026

    @stablebar-releases

    🎉 This issue has been resolved in version 0.12.0 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugreleased

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions