Skip to content

WebView2 is not displayed on the X11 Skia target under WSLg (Weston/XWayland) #23735

Closed

Description

@ramezgerges

Current behavior 🐛

On an Uno Platform Desktop (Skia) app running on the X11 target under WSLg (Windows Subsystem for Linux GUI, which uses Weston/XWayland), a WebView2 control is never displayed: the app window renders normally, but the area where the WebView should appear stays empty/transparent.

xwininfo -root -tree shows the WebKitGTK window is not embedded in the app's window — it is held under the Weston window manager's own frame window (a 10x10 window at the origin), so it is clipped away entirely. Depending on timing it can also be observed as a 1x1 window at -1,-1.

The same app works correctly on Windows and on typical Linux desktop window managers (mutter/KWin).

Root cause (two layered problems):

  1. X11XamlRootHost.AttachSubWindow passes an XWindowAttributes buffer to XChangeWindowAttributes, which expects the differently-laid-out XSetWindowAttributes. Due to a struct-layout coincidence, the override_redirect value actually applied comes from map_installed (offset 88) — usually 1 for plain default-colormap windows, but 0 for GTK windows (which use their own colormap). So the override-redirect flag the code intends to set is never reliably applied.
  2. Without override-redirect, Weston's XWM starts managing the WebKitGTK toplevel when GTK maps it and reparents it into its own frame window. Once Weston's XWM manages a window, reparenting it away is not reliably possible (it re-reparents the window under its own even after XWithdrawWindow). Mainstream desktop WMs release the window when it is reparented away, which is why this only breaks under Weston/WSLg.

Expected behavior 🎯

The WebView2 control displays and works normally when the app runs on the X11 target under WSLg (and Weston/XWayland environments in general).

How to reproduce it (as minimally and precisely as possible) 🔬

  1. Create a Desktop (Skia) app with a WebView2 control navigating to any page (e.g. dotnet new unoapp, add <WebView2 Source="https://platform.uno" />).
  2. Install the WebView2 Linux prerequisites (WebKitGTK 4.1 / GTK 3) per https://aka.platform.uno/webview2.
  3. Run the app inside WSL (WSLg) on Windows 11.
  4. The app window shows, the WebView area stays empty. xwininfo -root -tree shows the Uno WebView <random> window parented under the "Weston WM" window instead of the app window.

Workaround 🛠️

None found.

Renderer 🎨

  • Skia
  • Native

Affected platforms 📱💻🖥️

Desktop (X11)

Uno.Sdk version (and other relevant versions) 📦

Reproduced with Uno.Sdk 6.4.58 and with current master.

IDE version 🧑‍💻

No response

Anything else we need to know? 💬

Also affects any Weston/XWayland-based environment (e.g. kiosk-style Weston sessions), not just WSLg — the failing behavior is in Weston's XWM, which WSLg embeds.

Activity

  1. khaskoul commented on Aug 16, 2026

    @khaskoul
    Image

    Fix verified with:
    Templates/SDK: 6.7.10
    Platform(s): Desktop
    VS VSIX: 6.7.5
    IDE: VS 18.4.6
    OS: Windows WSL2

  2. self-assigned this
    on Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions