Skip to content

Create the GTK main webview lazily - #106

Merged
ctate merged 1 commit into
mainfrom
feat/gtk-lazy-main-webview
Jul 10, 2026
Merged

ctate merged 1 commit into
mainfrom
feat/gtk-lazy-main-webview

Conversation

@ctate

@ctate ctate commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Why

The Linux host created the main WebKitWebView eagerly at every window create — so pure canvas apps booted WebKit web and network processes they never used, required libwebkitgtk sandbox workarounds in CI, and carried web machinery at runtime for no reason. The macOS host has been lazy for a while; this brings GTK to parity.

What

  • Window create builds only GTK chrome; the main WebKitWebView materializes on first web use (load, main-frame set-frame/zoom/layer), with the zero:// scheme and bridge registration moving into materialization — registerable from either the main or a child webview, idempotent across windows
  • Every main-webview dereference in the host audited into ensure (creates on demand) or peek (honestly no-ops) semantics; destroy paths handle never-created webviews
  • The canvas smoke gains a permanent regression assertion: canvas apps must spawn zero WebKit processes — and the WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS workaround it existed for is deleted
  • Fixes a latent bug laziness exposed: child-webview bridge responses were dropped unless the main webview existed

Verification

Containerized GTK (Ubuntu 24.04, WebKitGTK 2.52, Xvfb — the CI package set):

  • Canvas smoke passes with no WebKit env vars, zero WebKit processes asserted after first frame and at end of run
  • Webview example as positive control: main webview materializes into an already-shown window on demand, page renders, JS→native→JS bridge round-trips, child webviews and a second JS-opened window work with no scheme double-registration
  • zig build test-webview-system-link -Dplatform=linux passes in-container; macOS-side suite, validate, and examples battery green

- Window create builds only GTK chrome; the main WebKitWebView materializes on first web use with the zero scheme and bridge registration riding along, so canvas apps never start WebKit processes on Linux
- The canvas smoke now asserts zero WebKit processes and drops the sandbox workaround it existed for; child-webview bridge responses no longer require a main webview to exist

Co-authored-by: WhiteHades <44260523+WhiteHades@users.noreply.github.com>
@vercel

vercel Bot commented Jul 10, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
native-sdk Ready Ready Preview, Comment Jul 10, 2026 10:11pm

@ctate
ctate merged commit edbb204 into main Jul 10, 2026
21 checks passed
ctate added a commit that referenced this pull request Jul 11, 2026
- Bump the CLI, platform packages, and runtime version to 0.4.4.

- Fold the v0.4.4 release notes for #105, #106, #107, and #110 into the marked changelog entry.

- Credit co-authors in the v0.4.4 release notes and repair the v0.4.3 contributor list.
@ctate ctate mentioned this pull request Jul 11, 2026
ctate added a commit that referenced this pull request Jul 11, 2026
- Bump the CLI, platform packages, and runtime version to 0.4.4.

- Fold the v0.4.4 release notes for #105, #106, #107, and #110 into the marked changelog entry.

- Credit co-authors in the v0.4.4 release notes and repair the v0.4.3 contributor list.

This branch was successfully deployed

1 active deployment
Preview — 7833a913 Deployed Jul 10, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant