Repository navigation
Fix/webkit autodetect software render - #22
Merged
Merged
Conversation
…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.
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.
No description provided.