Repository navigation
fix(x11): Disable GDK frame sync on embedded webview window - #23835
ramezgerges merged 3 commits into
Conversation
Mutter/GNOME (both Xorg and XWayland) advertises _NET_WM_FRAME_DRAWN, so GDK waits for the WM to acknowledge each frame before painting the next one. The webview window is reparented into the app's window and never managed by the WM, so no acknowledgement ever comes, GDK's frame clock stalls, and WebKit never paints (permanently blank webview). Weston (WSLg) and wlroots compositors don't support frame sync, so this is a no-op there. fixes unoplatform#23159 Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR updates the Linux/X11 WebView (WebKitGTK) host window initialization to disable GDK “frame sync” on the embedded/reparented WebView window, avoiding scenarios where GTK waits indefinitely for a window-manager frame acknowledgement that will never arrive for an unmanaged/reparented window (resulting in blank/non-updating WebView contents).
Changes:
- Add a new
libgdk-3.soP/Invoke forgdk_x11_window_set_frame_sync_enabled(). - Disable GDK frame sync on the realized WebView toplevel window before it is mapped/reparented.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-Authored-By: Claude Fable 5 <[email protected]>
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23835/wasm-skia-net9/index.html |
Co-Authored-By: Claude Fable 5 <[email protected]>
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23835/wasm-skia-net9/index.html |
|
|
GitHub Issue: closes #23159
PR Type:
🐞 Bugfix
What changed? 🚀
On GNOME (Mutter — both Xorg and XWayland sessions),
WebView2on Skia X11 renders a permanently blank panel. Historically it was flaky (blank until scrolling forced a repaint); since 6.7.0-dev.123 (#23736) it stopped rendering entirely.Root cause
Mutter advertises
_NET_WM_FRAME_DRAWN(compositor frame synchronization), so GDK paints a frame only after the WM acknowledges the previous one. The WebKitGTK window hosting the webview is reparented into the application's X11 window and is therefore never managed by the WM — no acknowledgement ever arrives, GDK's frame clock stalls, and WebKit stops painting. The X11 side is entirely healthy (correct parent, mapped, viewable, correct geometry); the window is just never drawn into.Weston (WSLg) and wlroots-based compositors (sway, etc.) don't support frame sync, so GTK falls back to a timer-driven frame clock there — which is why the issue only reproduces on GNOME.
#23736 didn't regress this at the X11 level: before it, the marshaling bug in
AttachSubWindowmeant override-redirect was effectively never applied, so the window sometimes got briefly managed by Mutter during the map/attach race, letting a few frames through — the "blank until you scroll" flakiness reported in #23159. Making "never managed" deterministic made the stall permanent.Fix
Call
gdk_x11_window_set_frame_sync_enabled(window, FALSE)on the GDK window right afterRealize()— GDK's opt-out for exactly this scenario. The override-redirect handling from #23736 is unchanged (still required for Weston's XWM).Validation
SamplesApp→WebView2_Basicrenders the page with the fix; a negative control build (same everything minus the one call) reproduces the permanently blank webview. Fails-before / passes-after, screenshot-verified.PR Checklist ✅
WebView2_Basicmanual-test sample; the failure depends on the window manager (GNOME/Mutter), which CI test environments don't exercise.Screenshots Compare Test Runresults.🤖 Generated with Claude Code