Repository navigation
Labels
triage/untriagedIndicates an issue requires triaging or verification
Description
Current behavior 🐛
Splitting out from: #23142 (comment)
Use of WebView2 within Uno.Gallery crashes:
git clone https://github.com/unoplatform/Uno.Gallery.git
cd Uno.Gallery
git checkout 54a08b1587aa020a5651d61eb3a3023a79e89d72
sed -i '' 's/"Uno.Sdk": ".*"/"Uno.Sdk": "6.6.0-dev.216"/g' global.json
dotnet publish -c Release -r linux-arm64 -f net10.0-desktop -p:TargetFrameworkOverride=net10.0-desktop \
-bl Uno.Gallery/Uno.Gallery.csproj -p:SelfContained=true -p:UseSkiaRendering=true
./Uno.Gallery/bin/Release/net10.0-desktop/linux-arm64/publish/Uno.Gallery Navigate to UI components > WebView in the left-hand tree, and the app immediately crashes:
fail: Uno.WinUI.Runtime.Skia.X11.X11NativeOverlappedPresenter[0]
Couldn't get OverlappedPresenterState: _NET_WM_STATE does not exist on the window. Make sure you use an EWMH-compliant WM.
fail: Uno.WinUI.Runtime.Skia.X11.X11NativeOverlappedPresenter[0]
Couldn't get OverlappedPresenterState: _NET_WM_STATE does not exist on the window. Make sure you use an EWMH-compliant WM.
(Uno.Gallery:8586): Gdk-CRITICAL **: 14:46:16.851: gdk_x11_window_get_xid: assertion 'GDK_IS_X11_WINDOW (window)' failed
X Error of failed request: BadWindow (invalid Window parameter)
Major opcode of failed request: 3 (X_GetWindowAttributes)
Resource id in failed request: 0x0
Serial number of failed request: 103
Current serial number in output stream: 104
Expected behavior 🎯
No crash. WebView2 works.
How to reproduce it (as minimally and precisely as possible) 🔬
No response
Workaround 🛠️
No response
Renderer 🎨
- Skia
- Native
Affected platforms 📱💻🖥️
Desktop (X11)
Uno.Sdk version (and other relevant versions) 📦
Uno.Sdk 6.6.0-dev.216.
IDE version 🧑💻
No response
Anything else we need to know? 💬
This occurs on a Parallels VM, running an "Ubuntu 24.04.3 ARM64" image.
I also needed to run:
sudo apt install libwebkit2gtk-4.1-devin order to get the "unversioned" libwebkit2gtk-4.1.so which is used by a [DllImport]:
| [DllImport("libwebkit2gtk-4.1.so", CallingConvention = CallingConvention.Cdecl)] |
Metadata
Metadata
Assignees
Labels
triage/untriagedIndicates an issue requires triaging or verification
Activity
agneszitte commentedon May 15, 2026
@khaskoul, @jhanvi03 can you please validate the impact of this issue with the latest 6.6 Uno.Sdk stable versions please
Don't hesitate to sync with @jonpryor, @Xiaoy312, and @ramezgerges to review the details, please
khaskoul commentedon May 15, 2026
UnoApp1 (copy).zip
I was able to reproduce the issue on both Uno Gallery and on an uno app with only a Webview
Copilot provided the following brief on the issue:
ramezgerges commentedon May 15, 2026
This behaviour is documented in
uno/doc/articles/controls/WebView.md
Lines 198 to 206 in ffbb0c0
We should try setting this on startup instead of forcing users to figure this out. I've tried this before unsuccessfully through
Environment.SetEnvorionmentVariable, which as @jonpryor mentioned to me, doesn't actually internally make thesetenvcall. More details at dotnet/runtime#4538 (comment). We would have tosetenvourselves.francoistanguay commentedon Jul 1, 2026
@ramezgerges @MartinZikmund Update on this?
fix(linux): X11NativeWebView exports GDK_BACKEND=x11
khaskoul commentedon Jul 20, 2026
@jonpryor @ajpinedam @ramezgerges WebView2 no longer crashes however the site does not actually load.
This issue only occurs on Linux.
Tested using:
Uno.Sdk/Templates: 6.7.0-dev.127
Rider Plugin: 1.10.53
jonpryor commentedon Jul 21, 2026
@khaskoul wrote:
Trying to repro:
Run the Debug build:
Once launched, click UI components > WebView.
Right away, there's a problem: I cannot click UI components > WebView! I can't click anything in the left-hand "tree" panel!
(Ruh roh.)
Fortunately I can search. Click the Search 🔍 textbox, type
WebView, and click the entry which is shown.The WebView page is shown.
The WebView doesn't work, thus reproducing what @khaskoul has observed.
App
stdoutcontains:As part of the When Did It Break? investigation, found a "workaround" for when the WebView contents aren't shown: scroll the UI components > WebView page. (Not the WebView within the page, but the right-most panel/page of the Uno.Gallery app.)
This workaround does not work on 6.7.0-dev.127, showing how cursed this version is.
jonpryor commentedon Jul 21, 2026
Given that everything is broken, can we narrow down what is broken?
Let's use stable Uno.Sdk 6.6.29!
The left-hand tree works! Yay!
Clicking UI components > WebView immediately crashes the app.
This is expected because #23635 isn't on 6.6.29, so export GDK_BACKEND and try again:
export GDK_BACKEND=x11 ./Uno.Gallery/bin/Debug/net10.0-desktop/Uno.GalleryThis still results in the message:
Click UI components > WebView, and two things of interest happen:
Firstly, we get the same message to stdout about scrolling:
Secondly, the contents of the WebView are "wrong". The first time I tried this, it was blank, just as @khaskoul reported. My most recent time, it's "corrupted":
Now, the "fun" thing: if I click a different item in the left-hand tree such as ViewBox, then click WebView again, it works!
Note that this behavior is seen with current stable Uno.Sdk 6.6.29.
jonpryor commentedon Jul 21, 2026
Time for my favorite activity: When Did It Break?
Bad Uno.Sdk versions
6.7.0-dev.123: Tree view does not work. Ctrl+F > "WebView" to navigate to UI Components > WebView works. WebView is initially empty; scrolling the WebView "panel" does not cause the WebView to be rendered.
6.7.0-dev.127
¯\(ツ)/¯ versions:
6.7.0-dev.10: behaves like "good-ish" 6.6.29, but worse: requires
export GDK_BACKEND=x11. Have observed the "flakiness" with 6.6.29 in that sometimes it doesn't render until switching to a different UI component and back to WebView, have seen the WebView over the wrong part of the window entirely, and have seen it disappear and not get "refreshed" when returning to WebView:Scrolling the Gallery window often fixes rendering.
6.7.0-dev.50: Similar to 6.7.0-dev.10: requires
export GDK_BACKEND=x11. First time I viewed UI components > WebView, nothing was shown ("bad"), but after scrolling the WebView page, the WebView content was updated and shown.6.7.0-dev.70: Similar to 6.7.0-dev.10: requires
export GDK_BACKEND=x11. Tree view works! First time I viewed UI components > WebView, nothing was shown ("bad"), but after scrolling the WebView page, the WebView content was updated and shown.6.7.0-dev.80: Similar to 6.7.0-dev.10: requires
export GDK_BACKEND=x11. Tree view works! First time I viewed UI components > WebView, nothing was shown ("bad"), but after scrolling the WebView page, the WebView content was updated and shown.6.7.0-dev.88: The tree view works. The WebView is shown, but in the wrong part of the screen, the same as 6.7.0-dev.101.
6.7.0-dev.93: The tree view works. The WebView is shown, but in the wrong part of the screen, the same as 6.7.0-dev.101.
6.7.0-dev.95: The tree view works. The WebView is shown, but in the wrong part of the screen, the same as 6.7.0-dev.101.
6.7.0-dev.97: Tree view does not work. The WebView is shown, but in the wrong part of the screen, the same as 6.7.0-dev.101.
6.7.0-dev.101: Tree view does not work. The WebView is shown, but in the wrong part of the screen.

stdout is full of "X11 protocol error" messages:
6.7.0-dev.107: Tree view does not work. Ctrl+F > "WebView" to navigate to UI Components > WebView works. WebView is initially empty; scrolling the WebView "panel" causes the WebView to be rendered.
6.7.0-dev.115: Tree view does not work. Ctrl+F > "WebView" to navigate to UI Components > WebView works. WebView is initially empty; scrolling the WebView "panel" causes the WebView to be rendered.
6.7.0-dev.121: Tree view does not work. Ctrl+F > "WebView" to navigate to UI Components > WebView works. WebView is initially empty; scrolling the WebView "panel" causes the WebView to be rendered.
Good (-ish?) Uno.Sdk versions:
jonpryor commentedon Jul 21, 2026
Summary of When Did It Break?:
The tree view broke between 6.7.0-dev.95 and 6.7.0-dev.97:
The web view was "wonky" for quite some time, and was never necessarily "stable" or "reliable", but it stopped working between 6.7.0-dev.121 and 6.7.0-dev.123:
jonpryor commentedon Jul 21, 2026
One oddity in theWebView2 breakage between 6.7.0-dev.121 and 6.7.0-dev.123: it's not only because of
Uno.UI.WebView.Skia.X11.dll.Build Uno.Gallery using Uno.Sdk 6.7.0-dev.123, then:
mv ./Uno.Gallery/bin/Debug/net10.0-desktop/Uno.UI.WebView.Skia.X11.dll ./Uno.Gallery/bin/Debug/net10.0-desktop/Uno.UI.WebView.Skia.X11.dll.bk cp $HOME/.nuget/packages/uno.winui.webview.skia.x11/6.7.0-dev.804/lib/net10.0/Uno.UI.WebView.Skia.X11.dll ./Uno.Gallery/bin/Debug/net10.0-desktop/Uno.UI.WebView.Skia.X11.dll ./Uno.Gallery/bin/Debug/net10.0-desktop/Uno.GalleryThe WebView2 does not work! (This does not make sense to me.)
Edited-to-add: to make this work we need to replace
Uno.UI.Runtime.Skia.X11.dll, notUno.UI.WebView.Skia.X11.dll:cp $HOME/.nuget/packages/uno.winui.runtime.skia.x11/6.7.0-dev.804/lib/net10.0/Uno.UI.Runtime.Skia.X11.dll Uno.Gallery/bin/Debug/net10.0-desktopSo try the opposite: build Uno.Gallery using Uno.Sdk 6.7.0-dev.121, verify that the WebView2 works 1, then:
mv ./Uno.Gallery/bin/Debug/net10.0-desktop/Uno.UI.WebView.Skia.X11.dll ./Uno.Gallery/bin/Debug/net10.0-desktop/Uno.UI.WebView.Skia.X11.dll.bk cp $HOME/.nuget/packages/uno.winui.webview.skia.x11/6.7.0-dev.815/lib/net10.0/Uno.UI.WebView.Skia.X11.dll ./Uno.Gallery/bin/Debug/net10.0-desktop/Uno.UI.WebView.Skia.X11.dll ./Uno.Gallery/bin/Debug/net10.0-desktop/Uno.GalleryThe WebView2 doesn't work. (This at least makes sense to me.)
Footnotes
note that "work" means "if the web page isn't shown, scroll the page to cause the WebView to render". ↩
fix(x11): Disable GDK frame sync on embedded webview window
khaskoul commentedon Aug 17, 2026
Fix verified with:
Templates/SDK: 6.7.10
Platform(s): Desktop
OS: Linux