fix(desktop): allow WebKitGTK media permission requests so huddles work on Linux#2481
Open
ryanrhughes wants to merge 1 commit into
Open
fix(desktop): allow WebKitGTK media permission requests so huddles work on Linux#2481ryanrhughes wants to merge 1 commit into
ryanrhughes wants to merge 1 commit into
Conversation
…rk on Linux WebKitGTK denies any permission request the embedder doesn't handle, and wry's WebKitGTK backend registers no permission-request handler (it only implements media permissions on Android and macOS). getUserMedia() has therefore always rejected on Linux: the huddle mic never connects, connectAndSetupMedia throws, and cleanupFailedStart tears the huddle down about a second after it starts. Connect the permission-request signal on webview ready and allow UserMediaPermissionRequest (mic/camera) and DeviceInfoPermissionRequest (device labels for the picker). Every other request type falls through to the default deny, so nothing is granted beyond media devices. No-op on macOS/Windows. Verified on Arch Linux (Hyprland/Wayland, webkit2gtk-4.1 2.52.4): huddles previously dropped ~1s after starting; with this change the mic connects and the huddle stays up. Signed-off-by: Ryan Hughes <ryan@heyoodle.com>
ryanrhughes
force-pushed
the
ryan/linux-huddle-media-permissions
branch
from
July 23, 2026 06:52
fa477aa to
4b505a6
Compare
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.
Problem
Huddles have never worked on the Linux desktop app: starting one tears itself down about a second later. The mic never connects.
Root cause: WebKitGTK denies any permission request the embedder doesn't handle, and wry's WebKitGTK backend registers no
permission-requesthandler (it implements media permissions only on Android and macOS — verified against wry 0.55.1 sources). SogetUserMedia()always rejects on Linux →connectAndSetupMediathrows →cleanupFailedStart()ends the huddle. The open dictation PR (#1511) adds UI copy for "mic permission denied" — that's this bug's symptom.Implementation
A small
linux-media-permissionsplugin indesktop/src-tauri/src/lib.rs: on webview ready, reach the nativewebkit2gtk::WebViewviawith_webviewand connectpermission-request, allowing exactly two request types:UserMediaPermissionRequest— mic/camera capture (huddles)DeviceInfoPermissionRequest— device labels for the input pickerEverything else returns
false, keeping WebKitGTK's default deny — nothing beyond media devices is granted. Compiled out entirely on macOS/Windows.Cargo.tomladds a Linux-onlywebkit2gtk = "2.0"dependency — the same crate + version Tauri already links (2.0.2 in the lockfile), needed only to name the types.Testing
An automated test is impractical here: the behavior lives in a native WebKitGTK signal handler that requires a live webview under a compositor. Verified manually on Arch Linux (Hyprland/Wayland, webkit2gtk-4.1 2.52.4):
Manual test steps: on any Linux machine, build the desktop app, join a community, start a huddle in a channel. Without this patch it self-ends within ~2s; with it, it stays connected.
Checklist
just ci: all gates pass exceptbuzz-dbunit testreplica_fence::tests::fence_starts_closed_and_opens_on_advance, which fails identically on pristinemain(timestamp precision mismatch:…237894Zvs…237894147Z, last touched in Route lag-tolerant reads to an optional Postgres read replica #2084) — pre-existing and unrelated; happy to file a separate issue.unwrap()/expect()in production paths; nounsafe.