← Back to Pull requests

Fix the double tooltip on the Close button #20981

Closed
unknown closed this pull request without merging on Nov 27, 2026 08:23 UTC
View on GitHub
unknown unknown commented on Nov 26, 2026 21:13 UTC
Author

Summary of the Pull Request

Hovering the Close button shows two tooltips: our XAML one, and the legacy system one on top of it. This removes the system one.

References and Relevant Issues

Regressed in #11680 (snap layouts), as noted in #12882.

Detailed Description of the Pull Request / Additional comments

Since #11680, the drag bar covers the caption buttons and _dragBarNcHitTest reports them as HTMINBUTTON / HTMAXBUTTON / HTCLOSE. The system shows its own tooltip for anything that hit-tests as HTCLOSE, on top of the XAML tooltip the titlebar already opens. Minimize doesn't get one (the drag bar window has no WS_MINIMIZEBOX), and Maximize shows the Snap Layouts flyout instead.

The close button now hit-tests as HTBORDER, which gets no tooltip and no default behavior. At the top of _InputSinkMessageHandler, non-client mouse messages (WM_NCMOUSEMOVE through WM_NCXBUTTONDBLCLK) with HTBORDER are handled exactly as if they were HTCLOSE, so hover, press, cancel and click go through the same code as before.

Maximize still returns HTMAXBUTTON, so Snap Layouts is unaffected.

I first tried skipping DefWindowProc for WM_NCMOUSEMOVE over the button, but that didn't help: the tooltip follows the hit-test result, not the mouse-move handling.

Validation Steps Performed

Built and deployed CascadiaPackage (Debug x64) and tested by hand:

  • Close: hover shows a single XAML tooltip (normal and maximized window)

  • Minimize: single tooltip, as before

  • Maximize: tooltip and Snap Layouts flyout both still appear

  • Press on Close, drag off, release: window stays open

  • Click Close: window closes
  • Before:
    <img width="179" height="83" alt="before-close-double-tooltip-cropped" src="https://github.com/user-attachments/assets/5a139bba-bdea-444e-8a72-a61aec1a8f6b" />

    After:
    <img width="480" height="270" alt="after-close-single-tooltip" src="https://github.com/user-attachments/assets/da2575d9-cea0-4656-bda4-0182eefef8a8" />
    <img width="480" height="270" alt="after-maximize-snap-layouts" src="https://github.com/user-attachments/assets/5d5f03f0-2055-4ddf-a7eb-767756c1cd66" />

    PR Checklist


  • Closes #12882

  • Tests added/passed

  • Documentation updated

  • - If checked, please file a pull request on our docs repo and link it here: #xxx
  • Schema updated (if necessary)
  • Diff: 298 lines (+223 / -75) across 3 files Reviewer: DHowett Review duration: 670m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 298 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.341
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #20981"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 40% (MEDIUM) · Higher = larger blast radius
    40%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 15.8% · Safe to merge
    15.8%