Skip to content

Fix/webkit autodetect software render - #22

Merged
t0msk merged 5 commits into
masterfrom
fix/webkit-autodetect-software-render
Oct 30, 2026
Merged

t0msk merged 5 commits into
masterfrom
fix/webkit-autodetect-software-render

Conversation

@t0msk

@t0msk t0msk commented Oct 26, 2026

Copy link
Copy Markdown
Owner

No description provided.

t0msk added 5 commits October 26, 2026 23:59
…ender

Previously the blank-window WebKitGTK bug (hardware-compositing/DMA-BUF
renderer failing silently on some GPU/driver combinations) required the
user to manually export WEBKIT_DISABLE_COMPOSITING_MODE and friends
before launching, as documented in README.md and docs/FLATPAK.md.

src-tauri/src/render_env.rs now applies that same fix automatically, but
only when it detects one of the two situations most consistently linked
to the bug: Nvidia's proprietary driver (/proc/driver/nvidia/version) or
running inside a VM (the "hypervisor" CPU flag). Everyone else keeps
GPU-accelerated rendering, which is the common case and noticeably
faster, matching the tradeoff already reasoned through in
docs/FLATPAK.md §1.5.

Any variable the user sets themselves still wins over detection, and
RUSTAB_FORCE_SOFTWARE_RENDER / RUSTAB_SKIP_RENDER_DETECTION cover the
cases detection doesn't. The variables this module sets are stripped
back out of the `xdg-open` child processes commands.rs spawns, so a
browser or file manager opened from Rustab never inherits a
software-rendering override meant for its own WebKitGTK instance.
…ck once

The previous commit's GPU-based detection (any Nvidia proprietary driver,
or any VM) was too broad: tested live, it forced software rendering for
every Nvidia user regardless of whether their machine actually hits the
WebKitGTK bug, trading away real scrolling/repaint performance for most
of them for nothing.

render_env::relaunch_supervised() replaces that guess with a real probe:
on every launch it re-executes this binary as a watched child and tries
hardware rendering first. The one failure actually reproduced while
building this fix (Nvidia's proprietary driver + a Wayland session) is
not a silent blank window but a fast, reliable crash -
"Gdk-Message: Error 71 (Protocol error) dispatching to Wayland display",
exit code 1, about 2.5-2.8s after launch every time. If the probe child
fails within that window, it's relaunched exactly once with the
software-render workaround forced; if it survives the window, it keeps
running as the real app, untouched.

A machine that was never affected pays nothing extra: the probe child is
the real, already-visible app for the whole watch window, not a separate
hidden launch. Only a machine where hardware rendering actually fails
pays a one-time visible relaunch before the software-render tradeoff
already documented in docs/FLATPAK.md §1.5 and README.md kicks in.
…licker

Trim render_env.rs's comments down to the repo's finished-work
convention (short, no design-history narrative) and fold in what
Submarine's own equivalent workaround cites: WebKit #258834 and
tauri-apps/tauri#9304, a Mesa >=24 instance of the same WebKitGTK
compositing fragility on Wayland - related to, but not the same bug as,
the Nvidia-proprietary-driver crash this fix was built against.

README.md's troubleshooting section now leads with what a user actually
sees (the window flashing/restarting once on an affected machine) rather
than the mechanism first, so it reads as "this is expected" instead of
looking like a crash.
More margin over the ~2.5-2.8s the one reproduced crash took, for other
machines/driver versions that might take a bit longer - costs nothing on
a working hardware path, since that child is already the real,
already-visible app for the whole window.
The window counts from process start, not from when rendering is
actually attempted, so a disk-bound cold start on slow hardware eats
into the same budget as the GPU-crash margin - 5s left too little room
for both. 10s keeps catching the crash (which still happens at the same
~2.5-2.8s observed timing, detected as soon as it occurs, not at the
window's end) while giving a slow machine time to even reach that code
path. No cost on a working hardware path: that child is the real,
already-visible app the whole time, window length or not.
@t0msk
t0msk merged commit bb7e2c9 into master Oct 30, 2026
5 checks passed
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