Repository navigation
Conversation
WebKitGTK ships its AllowWebGLInWorkers runtime feature disabled. That feature gates WebGL on every OffscreenCanvas, including canvases a document creates, so pages that probe or render through OffscreenCanvas get no WebGL context in Linux webviews. Chromium, Firefox and Safari 17+ enable these contexts by default. The Linux adapter now enables the feature on each view's settings before its first navigation. The WebKitGTK 2.42+ feature API is resolved at run time from the loaded library, because the published bindings stop at 2.40 and a direct link would stop older hosts from loading. Those hosts keep the engine default. Tests: - Unit test enables the feature on a display-free WebKitSettings object and reads it back. - New offscreen-webgl smoke scenario (added to the Xvfb CI lane) reports webgl2=0 with the facade call disabled and passes with it enabled. Port of #268 to main. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01VfXV1EpgAvMZzXJfbGZPRG
Creating a WebKitSettings object initializes GTK style and settings state, which aborts the whole test binary when no display connection exists. The rust-native job runs `cargo test --all-features` without a display, so the test is now ignored there and run explicitly with `--ignored` in the tauri-webview-smoke job under xvfb-run. Reproduced locally by hiding every display and the default Wayland socket: the test binary segfaulted in GTK style-provider assertions. With the attribute, the headless run reports the test as ignored and the Xvfb run passes it. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01VfXV1EpgAvMZzXJfbGZPRG
|
CI note: the failing checks on this PR are pre-existing on This PR's run (34914809661, head
The jobs that exercise this change pass: The same fix is merged to |
|
Closing without merging. Forcing WebKitGTK's AllowWebGLInWorkers freezes the FastLED viewer on NVIDIA Wayland: the web process crashes with a Skia GrResourceCache SIGILL (5 of 8 runs froze, versus 0 of 10 with the WebKitGTK default and main-thread rendering). The same toggle is being reverted on release/0.1.3; see the revert PR against that branch. My earlier CI note here stands, but the change itself should not land on main. |
Summary
Port of #268 (which targets
release/0.1.3for v0.1.4) tomain.WebKitGTK ships its
AllowWebGLInWorkersruntime feature disabled. Despite the name, it gates WebGL on everyOffscreenCanvas, including canvases a document creates, sonew OffscreenCanvas(1, 1).getContext('webgl2')returnsnullin Linux webviews. Chromium, Firefox and Safari 17+ expose these contexts by default. This blocked FastLED's viewer (FastLED/cli#247).The Linux adapter now enables the feature on each new view's settings before its first navigation. The WebKitGTK 2.42+ feature API is resolved at run time with
dlsym(RTLD_DEFAULT), because the publishedwebkit2gtkbindings stop at 2.40 and linking the symbols directly would stop older hosts from loading. The change is private tosrc/tauri/linux_webkitgtk.rsplus one call insrc/tauri.rs; the smoke scenario is re-applied by hand becausemain's smoke binary has diverged from the release branch.Evidence
offscreen-webglsmoke scenario, facade call disabled (RED)webgl2=0, failstauri::linux_webkitgtk(including the new display-free enable + read-back test)cargo clippy --features tauri-webview-test-support --all-targets -D warnings,cargo fmt --checkSmoke runs used the CI lane's environment (Xvfb, software GL, compositing disabled, WebKitGTK 2.52.5). The scenario is added to the
tauri-webview-smokeCI job.maincurrently has failing CI jobs unrelated to this change, so compare this PR's checks against the base branch's runs.Known limitation (not addressed here)
With the feature enabled, WebKitGTK 2.52 still lets only the first thread to create a WebGL context succeed. On NVIDIA 595.99.02 under Wayland, a document WebGL2 context followed by worker rendering crashes the web process in NVIDIA EGL during GL context teardown; this reproduces in stock
MiniBrowserand is tracked in FastLED/cli#247 for an upstream report.Refs #268, FastLED/cli#247.
🤖 Generated with Claude Code
https://claude.ai/code/session_01VfXV1EpgAvMZzXJfbGZPRG