Repository navigation
fix(webview): enable WebGL on OffscreenCanvas in WebKitGTK views - #268
Merged
Merged
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. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01VfXV1EpgAvMZzXJfbGZPRG
This was referenced Sep 15, 2026
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
zackees
added a commit
that referenced
this pull request
Sep 15, 2026
Release on release/0.1.3 containing #268 (enable WebGL on OffscreenCanvas in WebKitGTK views) on top of v0.1.3. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01VfXV1EpgAvMZzXJfbGZPRG
zackees
added a commit
to FastLED/cli
that referenced
this pull request
Sep 15, 2026
kernal-api v0.1.4 enables WebKitGTK's AllowWebGLInWorkers runtime feature in its Linux webview adapter (forge-ci/kernal-api#268). WebKitGTK ships it disabled, and it gates WebGL on every OffscreenCanvas, so the viewer's WebGL2 compatibility gate always failed on Linux. The fix lives in kernal-api; no local workaround is added here. - Pin the workspace dependency to the v0.1.4 tag and require it in the boundary test. - Log the frontend's OffscreenCanvas WebGL2 probe as unavailable when getContext returns null, instead of reporting SUCCESS unconditionally. - Correct the migration audit: the shared #247 failure was the WebKitGTK feature flag, not host GL. A WebKitGTK 2.52 + NVIDIA Wayland crash with document plus worker WebGL still blocks real rendering and is tracked upstream in #247. Refs #229, #247 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01VfXV1EpgAvMZzXJfbGZPRG
This was referenced Sep 15, 2026
zackees
added a commit
that referenced
this pull request
Sep 15, 2026
Release on release/0.1.3 containing #272, which reverts #268 (forced WebGL on OffscreenCanvas in WebKitGTK views). Code-wise this is v0.1.3. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01VfXV1EpgAvMZzXJfbGZPRG
zackees
added a commit
to FastLED/cli
that referenced
this pull request
Sep 15, 2026
kernal-api v0.1.5 reverts forge-ci/kernal-api#268, so WebKitGTK views keep their default of no WebGL on OffscreenCanvas. The viewer now renders on the main thread in that case (previous commit), which is the path the pre-migration viewer used. Forcing worker WebGL froze the canvas on NVIDIA Wayland. The migration record now corrects the earlier claim that #247 was an upstream WebKitGTK/driver crash. It records the renderer comparison and the Linux --test results. Refs #247 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01VfXV1EpgAvMZzXJfbGZPRG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
WebKitGTK ships its
AllowWebGLInWorkersruntime feature disabled. Despite the name, it gates WebGL on everyOffscreenCanvas, including canvases a document creates. As a result,new OffscreenCanvas(1, 1).getContext('webgl2')returnsnullin Linux webviews, while Chromium, Firefox and Safari 17+ expose these contexts by default. This blocked FastLED's viewer (FastLED/cli#247), whose browser-compatibility gate requires OffscreenCanvas WebGL2.The Linux adapter now enables the feature on each new view's settings, after bridge removal and before the first navigation.
webkit_settings_get_all_features,webkit_settings_set_feature_enabled, …) is resolved at run time withdlsym(RTLD_DEFAULT). The publishedwebkit2gtkbindings stop at 2.40, and linking the symbols directly would prevent older WebKitGTK hosts from loading. Those hosts keep the engine default.src/tauri/linux_webkitgtk.rsplus one call insrc/tauri.rs; no public API changes.Evidence
offscreen-webglsmoke scenario, facade call disabled (RED)webgl2=0, failswebkit_settings_enable_offscreen_canvas_webglunit test (display-free settings, enable + read back)cargo clippy --features tauri-webview-test-support --all-targets -D warnings,cargo fmt --checkAll smoke runs used the CI lane's environment: Xvfb,
GDK_BACKEND=x11,LIBGL_ALWAYS_SOFTWARE=1,WEBKIT_DISABLE_COMPOSITING_MODE=1, WebKitGTK 2.52.5. The scenario is added to thetauri-webview-smokeCI job.Known limitation (not addressed here)
With the feature enabled, WebKitGTK 2.52 still lets only the first thread to create a WebGL context succeed; a later context on another thread returns
null. On NVIDIA 595.99.02 under Wayland, a document WebGL2 context followed by worker rendering on a transferred canvas breaks the UI process (Error 71 (Protocol error) dispatching to Wayland display) and crashes the web process in NVIDIA EGL during GL context teardown. This reproduces in the stockMiniBrowser, so it is an engine/driver issue to report upstream, not something this facade should work around. Tracked in FastLED/cli#247.This PR targets
release/0.1.3for the v0.1.4 release. A matching PR againstmainfollows.Refs FastLED/cli#247, FastLED/cli#229.
🤖 Generated with Claude Code
https://claude.ai/code/session_01VfXV1EpgAvMZzXJfbGZPRG