Skip to content

fix(flyout): Pass transient overlay input through - #25085

Open
MartinZikmund wants to merge 2 commits into
masterfrom
dev/mazi/flyout-transient-passthrough
Open

MartinZikmund wants to merge 2 commits into
masterfrom
dev/mazi/flyout-transient-passthrough

Conversation

@MartinZikmund

Copy link
Copy Markdown
Member

GitHub Issue: closes #25080

PR Type:

🐞 Bugfix

What changed? 🚀

Transient flyouts (ShowMode = Transient / TransientWithDismissOnPointerMoveAway) swallowed the press that dismissed them. This ports WinUI's FlyoutBase::SetPopupLightDismissBehavior (FlyoutBase_partial.cpp) and the OverlayInputPassThroughElement property handling:

  • Transient show modes set the overlay pass-through element to the root visual, so a tap on the light-dismiss overlay both closes the flyout and reaches the element underneath (e.g. tapping text while the TextBox touch selection flyout is open).
  • The automatic pass-through is cleared when the show mode changes back, without touching an app-set value.
  • An app-set OverlayInputPassThroughElement is 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_Transient tests and the updated When_First_Second_Tap_Caret_Thumb_Shows pass; 8 of them fail without the change. The Flyout/MenuFlyout/CommandBarFlyout suites show no new failures (the Check_Placement_All_* failures also fail on master on this machine).

PR Checklist ✅

🤖 Generated with Claude Code

https://claude.ai/code/session_01VCiDmRi7D7F7qF1LHLhL5W

MartinZikmund and others added 2 commits October 7, 2026 18:50
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
Copilot AI balanced review requested due to automatic review settings October 7, 2026 16:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added the area/skia ✏️ Categorizes an issue or PR as relevant to Skia label Oct 7, 2026
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 24s —— View job


Review summary

Verdict: ship, with minor optional follow-ups.

  • Blocking issues: 0
  • Minor suggestions: 2 (inline)

The change is a faithful port of SetPopupLightDismissBehavior and UpdateStateToShowMode. It has MUX headers and the .partial.mux / .partial.h.mux / .uno split. Weak storage and the "owned vs app-set" tracking are handled correctly: the property-changed callback clears ownership, and it runs before ownership is set. Tests cover the new behavior and I found no skipped tests.

I reviewed by inspection only. I did not build or run anything.

Cross-cutting notes:

  • m_shouldHideIfPointerMovesAway is tracked, but pointer-move-away dismissal is still a TODO. This is documented in the code and is acceptable.
  • Docs checklist items are unchecked. That is fine for a bugfix.

if (m_shouldOverlayPassThroughAllInput)
{
var overlayInputPassThroughElement = OverlayInputPassThroughElement;
if (overlayInputPassThroughElement is null)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 237975 found UI Test snapshots differences: skia-linux-screenshots: 118, skia-windows-screenshots: 1137

Details
  • skia-linux-screenshots: 118 changed over 2458

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ClipboardTests.png-dark
    • Buttons.png-dark
    • Buttons.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • CompositionEffectBrush.png-dark
    • CompositionEffectBrush.png
    • CompositionNineGridBrush_Source_Changes.png-dark
    • CompositionNineGridBrush_Source_Changes.png
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • Examples.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • DisplayInformation.png-dark
    • ImageBrushInList.png-dark
  • skia-windows-screenshots: 1137 changed over 2474

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AnimatedBackVisualSourceSamplePage.png-dark
    • AppBarButtonWithIconTest.png
    • AutoSuggestBox_Icons.png-dark
    • AutoSuggestBox_Icons.png
    • BasicEnability.png-dark
    • BitmapIcon_Foreground.png-dark
    • BitmapIcon_Foreground.png
    • Border_CornerRadius_Gradient.png-dark
    • Border_CornerRadius_Gradient.png
    • Border_LinearGradientBrush.png-dark
    • Border_LinearGradientBrush.png
    • Button_Opacity_Automated.png-dark
    • Button_Opacity_Automated.png
    • ColorPickerSample.png-dark
    • ColorPickerSample.png
    • ComboBox_Stretch.png-dark
    • ComboBox_Stretch.png
    • ContentControl_ComboBoxSetNull.png-dark
    • ContentControl_ComboBoxSetNull.png
    • ContentPresenter_NativeEmbedding_ZIndex.png-dark

@morning4coffe-dev morning4coffe-dev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. 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 checks overlayInputPassThroughElementNoRef->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 on other, 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.

  2. 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.

  3. 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.

  4. 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.

  5. Nit: in FlyoutBase.uno.cs the comment sits between the member signature and the => body. Move it above the member.

@mergify

mergify Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue). If it does not match the queue conditions yet, it enters the queue once it does.

  • Queue this pull request

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

Labels

area/skia ✏️ Categorizes an issue or PR as relevant to Skia

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Skia] Transient flyouts swallow the input that dismisses them

4 participants