From 3915a82780d72186dce939aa7b8043a6373bbcaf Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Sat, 27 Jun 2026 11:52:02 +0000 Subject: [PATCH] fix(host/input): route KWin auto-detect to the fake_input backend MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit apply_input_env() hard-pinned PUNKTFUNK_INPUT_BACKEND=libei for KWin, and default_backend() reads that env first — so the auto-detecting host (the normal `serve` service) ignored the new KwinFakeInput backend and fell back to the RemoteDesktop portal path that needs a user to approve. Route KWin to "kwin" (org_kde_kwin_fake_input); GNOME/Mutter stay on libei (no fake_input there). Validated live on a Bazzite KDE box via the auto-detect path: backend=KwinFakeInput, "KWin fake_input ready (no portal)", input events forwarded with no errors. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/punktfunk-host/src/vdisplay.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/punktfunk-host/src/vdisplay.rs b/crates/punktfunk-host/src/vdisplay.rs index ef7c754..92e7fed 100644 --- a/crates/punktfunk-host/src/vdisplay.rs +++ b/crates/punktfunk-host/src/vdisplay.rs @@ -457,7 +457,11 @@ pub fn settle_desktop_portal(_chosen: Compositor) {} pub fn apply_input_env(chosen: Compositor) { let backend = match chosen { Compositor::Gamescope => "gamescope", - Compositor::Kwin | Compositor::Mutter => "libei", + // KWin: org_kde_kwin_fake_input — direct injection, no RemoteDesktop portal / approval + // dialog (headless, the krdpserver path), authorized by the host's shipped .desktop. + Compositor::Kwin => "kwin", + // GNOME has neither fake_input nor the wlr protocols → RemoteDesktop portal via libei. + Compositor::Mutter => "libei", Compositor::Wlroots => "wlr", }; std::env::set_var("PUNKTFUNK_INPUT_BACKEND", backend);