Repository navigation
fix(flyout): Pass transient overlay input through - #25085
MartinZikmund wants to merge 2 commits into
Conversation
Ports FlyoutBase::SetPopupLightDismissBehavior: transient show modes route overlay input to the root visual, and an app-set OverlayInputPassThroughElement is honoured. Co-authored-by: morning4coffe-dev <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VCiDmRi7D7F7qF1LHLhL5W
Co-authored-by: morning4coffe-dev <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VCiDmRi7D7F7qF1LHLhL5W
|
Claude finished @MartinZikmund's task in 24s —— View job Review summaryVerdict: ship, with minor optional follow-ups.
The change is a faithful port of I reviewed by inspection only. I did not build or run anything. Cross-cutting notes:
|
| if (m_shouldOverlayPassThroughAllInput) | ||
| { | ||
| var overlayInputPassThroughElement = OverlayInputPassThroughElement; | ||
| if (overlayInputPassThroughElement is null) |
There was a problem hiding this comment.
Stale auto-set pass-through on reopen (minor). The overlayInputPassThroughElement is null check also skips re-assignment when a previous owned value (m_ownsOverlayInputPassThroughElement == true) points at the root of a different XamlRoot (e.g. flyout reopened in another window). The pass-through then targets a stale root. Consider refreshing when m_ownsOverlayInputPassThroughElement is true and the value differs from the current root visual.
| return; | ||
| } | ||
|
|
||
| var point = args.GetCurrentPoint(null); |
There was a problem hiding this comment.
Behavior change worth a test. Removing the "must be an ancestor of the Flyout" guard means an app-set pass-through element outside the flyout's tree now works. That matches WinUI, but the hit test now uses XamlRoot?.VisualTree.RootElement rather than passThroughElement.XamlRoot. If the pass-through element lives in a different XamlRoot, the ancestry check can never match and silently blocks input. A runtime test for that case, or a note that it is unsupported, would help.
|
The build 237975 found UI Test snapshots differences: Details
|
morning4coffe-dev
left a comment
There was a problem hiding this comment.
Verified against WinUI: FlyoutBase_partial.cpp (SetPopupLightDismissBehavior ~1426, UpdateStateToShowMode ~3938, OnPropertyChanged2 ~858) and PointerInputProcessor.cpp (~1091-1135). The show-mode table, root-visual pass-through, the ownership flag, and removal of the "must be a parent of the Flyout" guard all match. Code review only; I did not run the runtime tests.
Findings, most severe first:
-
Parity deviation in FlyoutPopupPanel.cs (~lines 65-67). The new clause
ReferenceEquals(passThroughElement, elementHitUnderOverlay)lets a press on the pass-through element itself through. WinUI checksoverlayInputPassThroughElementNoRef->IsAncestorOf(subtreeHitTestDO)(PointerInputProcessor.cpp ~1111-1130), and CDependencyObject::IsAncestorOf (dependencyobject.cpp:349) is strict: it starts at the object's parent, so an element is not its own ancestor. In WinUI, such a press is swallowed by light-dismiss. The new test When_Managed_Overlay_PassThrough_Only_Forwards_Within_Its_Subtree (withinSubtree=true, pass-through =other, press onother, expects clicks == 1) asserts this deviation, and it is Skia-only, so it does not confirm WinUI behaviour. Please either provide a WinUI-verified reason for the self-match, or drop the clause and fix the expectation. -
Gap: WinUI suppresses the placement-target Button's flyout re-open when the press is forwarded into a pass-through subtree that contains that Button (PointerInputProcessor.cpp ~1118-1131, Button_SuppressFlyoutOpening). Uno's hook is commented out (Button.mux.cs:37-38, 130-151, "TODO Uno: ... where to call SuppressFlyoutOpening"), and the ReRoute path does not call it. A Button with a Flyout inside a pass-through container would likely close and immediately reopen its flyout. Please add a test or record it as a known follow-up.
-
Minor: UpdateStateToShowMode, when the popup is open, calls SetPopupLightDismissBehavior but not ConfigurePopupOverlay (WinUI FlyoutBase_partial.cpp ~3977-3978). WinUI derives overlay visibility from IsLightDismissEnabled there. The code comment says Uno's bindings cover this. Please confirm with a Transient to Standard change while open.
-
Nit: the When_First_Second_Tap_Caret_Thumb_Shows rewrite presses at computed glyph points and wraps the body in try/finally. Briefly say why the original centre press no longer works.
-
Nit: in FlyoutBase.uno.cs the comment sits between the member signature and the
=>body. Move it above the member.
|
Tick the box to add this pull request to the merge queue (same as
|
GitHub Issue: closes #25080
PR Type:
🐞 Bugfix
What changed? 🚀
Transient flyouts (
ShowMode = Transient/TransientWithDismissOnPointerMoveAway) swallowed the press that dismissed them. This ports WinUI'sFlyoutBase::SetPopupLightDismissBehavior(FlyoutBase_partial.cpp) and theOverlayInputPassThroughElementproperty handling:OverlayInputPassThroughElementis honoured even when it is not an ancestor of the placement target, and is stored weakly as in WinUI.Split out of the RichEditBox PR #23924 (original port by @morning4coffe-dev).
Validation (Skia Win32): the new
Given_Flyout_Transienttests and the updatedWhen_First_Second_Tap_Caret_Thumb_Showspass; 8 of them fail without the change. The Flyout/MenuFlyout/CommandBarFlyout suites show no new failures (theCheck_Placement_All_*failures also fail on master on this machine).PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code
https://claude.ai/code/session_01VCiDmRi7D7F7qF1LHLhL5W