Skip to content

[PresentationFramework] Tooltip safe-area handling can throw during hover transitions #11462

@etvorun

Description

@etvorun

[PresentationFramework] Tooltip safe-area handling can throw during hover transitions

Summary

Tooltip processing can throw when pointer movement intersects with a tooltip whose underlying window/source is disposed during hover transitions.

Observed behavior

  • In tooltip-heavy UI paths, moving the mouse near or over tooltip boundaries can trigger an exception in tooltip coordinate processing.
  • The failure is intermittent and timing-sensitive, so it can be difficult to reproduce deterministically.

Repro notes

  1. Run a WPF app with controls that frequently show/hide tooltips.
  2. Move the mouse quickly across controls while tooltips are opening/closing.
  3. Observe occasional exceptions originating from tooltip safe-area coordinate conversion paths.

Impact

  • This can crash or destabilize applications during normal tooltip interaction.
  • Apps with dense UI surfaces and frequent tooltip activity are more likely to be affected.

Expected behavior

Tooltip transitions should remain safe even if the tooltip's underlying source/window is disposed mid-flow.

Actual behavior

The tooltip path may still use a previously captured safe-area source that has already been disposed, causing coordinate conversion to fail and throw.

Suspected root cause

Safe-area checks only validated presence (SafeArea != null) and did not validate whether the underlying PresentationSource was still alive when used.

Proposed fix direction

  • Introduce a validity gate for safe-area usage, not just null checks.
  • Treat disposed safe-area sources as invalid and fall back to behavior equivalent to "no safe area".
  • Route tooltip mouse-trigger logic and safe-area exit checks through the new validity gate.
  • Expose convex hull/source validity in a minimal internal property used by tooltip logic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions