Fix the double tooltip on the Close button #20981
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
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
DHowett
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
_dragBarNcHitTestreports them asHTMINBUTTON/HTMAXBUTTON/HTCLOSE. The system shows its own tooltip for anything that hit-tests asHTCLOSE, on top of the XAML tooltip the titlebar already opens. Minimize doesn't get one (the drag bar window has noWS_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_NCMOUSEMOVEthroughWM_NCXBUTTONDBLCLK) withHTBORDERare handled exactly as if they wereHTCLOSE, 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
DefWindowProcforWM_NCMOUSEMOVEover 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: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
- If checked, please file a pull request on our docs repo and link it here: #xxx