Skip to content

WebView2 fixes - #23226

Merged
agneszitte merged 9 commits into
masterfrom
dev/xygu/20260507/webview-patches
May 8, 2026
Merged

agneszitte merged 9 commits into
masterfrom
dev/xygu/20260507/webview-patches

Conversation

@Xiaoy312

@Xiaoy312 Xiaoy312 commented May 7, 2026 •

Copy link
Copy Markdown
Contributor

GitHub Issue:
closes https://github.com/unoplatform/kahua-private/issues/449
closes https://github.com/unoplatform/kahua-private/issues/467
closes https://github.com/unoplatform/kahua-private/issues/471

PR Type: 🐞 Bugfix

What changed? 🚀

PR Checklist ✅

Xiaoy312 added 2 commits May 7, 2026 12:39
…0260504/win32-native-element-coords""

This reverts commit bfc23e2.
Copilot AI review requested due to automatic review settings May 7, 2026 16:57
@Xiaoy312 Xiaoy312 added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 7, 2026

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.

Pull request overview

This PR adjusts Win32 WebView2 and native HWND hosting behavior in the Skia.Win32 backend to reduce visual glitches during initial WebView2 setup (black flash / animation artifacts) and to make native child-window z-ordering more deterministic.

Changes:

  • Updated WebView2 window initialization to disable DWM transitions and tweaked controller initialization/visibility to improve first-load visuals.
  • Deferred native child HWND positioning to a render-adjacent callback to reduce flicker during scrolling/movement, and changed the “first show” gating to occur after the first render that consumed an arrange.
  • Added deterministic native HWND z-order handling via a per-parent tracked ordering map.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/Uno.UI.Runtime.Skia.Win32/UI/Xaml/Controls/WebView/Win32NativeWebView.cs Disables DWM transitions for the WebView2 host window and adjusts controller initialization to reduce initial visual artifacts.
src/Uno.UI.Runtime.Skia.Win32/Native/Win32NativeElementHostingExtension.cs Defers SetWindowPos to render-time for reduced flicker and introduces deterministic z-ordering for hosted native HWNDs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20260507/webview-patches branch from 4d7cb81 to ffbb16b Compare May 7, 2026 17:33
Copilot AI review requested due to automatic review settings May 7, 2026 22:02
@github-actions github-actions Bot added the area/skia ✏️ Categorizes an issue or PR as relevant to Skia label May 7, 2026

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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

Copilot AI review requested due to automatic review settings May 7, 2026 22:54
@Xiaoy312 Xiaoy312 removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 7, 2026

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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 211578 found UI Test snapshots differences: skia-linux-screenshots: 59, skia-windows-screenshots: 428, wasm: 13

Details
  • skia-linux-screenshots: 59 changed over 2342

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Buttons.png-dark
    • Buttons.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • CalendarView_Theming.png-dark
    • DisplayInformation.png-dark
    • DisplayInformation.png
    • EllipsemaskingEllipseGrid.png-dark
    • EllipsemaskingEllipseGrid.png
    • ImageSourceUrlMsAppDataScheme.png-dark
    • ImageSourceUrlMsAppDataScheme.png
    • ClipboardTests.png-dark
    • Focus_FocusVisual_Properties.png-dark
    • ImageIconPage.png-dark
    • ImageIconPage.png
    • Examples.png-dark
    • Examples.png
    • CalendarView_Theming.png
    • ColorPickerSample.png-dark
    • ColorPickerSample.png
  • skia-windows-screenshots: 428 changed over 2342

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AndroidWindowInsets.png-dark
    • ApplicationViewSpanningRectsPage.png
    • BitmapIcon_Foreground.png-dark
    • ClippingWithOpacity.png-dark
    • ClippingWithOpacity.png
    • ElevatedView_Tester.png-dark
    • ElevatedView_Tester.png
    • Elevation.png-dark
    • Elevation.png
    • IconSourceElementTests.png-dark
    • IconSourceElementTests.png
    • Battery.png-dark
    • Accessibility_ScreenReader.png
    • AutomationProperties_AutomationId.png-dark
    • BitmapIcon_Monochromatic.png-dark
    • BorderVersusPanelClipping.png-dark
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Clipping652.png-dark
    • Clipping652.png
  • wasm: 13 changed over 1074

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • UITests.Shared.Microsoft_UI_Xaml_Controls.ExpanderTests.WinUIExpanderPage
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Minimal
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Ogg_Extension
    • UITests.Uno_Web.Http.CookieManagerTests
    • UITests.Windows_UI_Xaml_Media_Animation.ColorAnimation_Background
    • UITests.Microsoft_UI_Xaml_Controls.ColorPickerTests.ColorPickerSample
    • initial_state
    • UITests.Windows_UI_Xaml.Performance.Performance_1000ButtonsContinuousRendering
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected
    • UITests.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_NavigationProperties
    • UITests.Windows_UI_Xaml_Controls.CalendarView.CalendarView_Theming
    • Uno.UI.Samples.Content.UITests.WebView.WebView_AnchorNavigation
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewSelectedItems

Copilot AI review requested due to automatic review settings May 8, 2026 13:54

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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20260507/webview-patches branch from c91f641 to 561c37b Compare May 8, 2026 14:05
@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20260507/webview-patches branch from 561c37b to 242b4cc Compare May 8, 2026 14:12
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 211672 found UI Test snapshots differences: skia-linux-screenshots: 59, skia-windows-screenshots: 54, wasm: 13

Details
  • skia-linux-screenshots: 59 changed over 2342

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • DropDownButtonPage.png-dark
    • Examples.png-dark
    • Examples.png
    • DisplayInformation.png-dark
    • DisplayInformation.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • Focus_FocusVisual_Properties.png-dark
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
    • ColorPickerSample.png-dark
    • ColorPickerSample.png
    • ImageIconPage.png-dark
    • ImageIconPage.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
  • skia-windows-screenshots: 54 changed over 2344

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Examples.png-dark
    • Examples.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • Buttons.png-dark
    • Buttons.png
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • ContentPresenter_TextProperties.png-dark
    • ContentPresenter_TextProperties.png
    • ContextRequested.png-dark
    • ContextRequested.png
    • ContentPresenter_Template.png-dark
    • ContentPresenter_Template.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
  • wasm: 13 changed over 1074

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • initial_state
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Minimal
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Ogg_Extension
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewSelectedItems
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected
    • UITests.Uno_Web.Http.CookieManagerTests
    • UITests.Windows_UI_Xaml_Controls.CalendarView.CalendarView_Theming
    • Uno.UI.Samples.Content.UITests.WebView.WebView_AnchorNavigation
    • UITests.Shared.Microsoft_UI_Xaml_Controls.ExpanderTests.WinUIExpanderPage
    • UITests.Microsoft_UI_Xaml_Controls.ColorPickerTests.ColorPickerSample
    • UITests.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_NavigationProperties
    • UITests.Windows_UI_Xaml.Performance.Performance_1000ButtonsContinuousRendering
    • UITests.Windows_UI_Xaml_Media_Animation.ColorAnimation_Background

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 211672 has failed on Uno.UI - CI.

@agneszitte
agneszitte merged commit f99860d into master May 8, 2026
46 checks passed
@agneszitte
agneszitte deleted the dev/xygu/20260507/webview-patches branch May 8, 2026 16:40
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.

7 participants