From 799bc03a815dc024d314e6dbf19ee877951c97cd Mon Sep 17 00:00:00 2001 From: rustdesk Date: Sat, 10 Oct 2026 16:22:59 +0800 Subject: [PATCH] fix(linux): report the process user as the active user under Flatpak File transfer to a Flatpak peer always failed with "No active console user logged on", because PeerInfo.username came from loginctl, which the sandbox cannot reach: Flathub builds lack the org.freedesktop.Flatpak talk-name, so `flatpak-spawn --host` fails. A Flatpak instance only runs inside the logged-in user's own session, so that user is the active one. Fixes #16506 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01WS1HTjp6UQuG43KEcQPq1R --- src/platform/linux.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/platform/linux.rs b/src/platform/linux.rs index 169e63021..013c05307 100644 --- a/src/platform/linux.rs +++ b/src/platform/linux.rs @@ -1302,6 +1302,11 @@ fn _get_display_manager() -> String { /// Returns the cached active username when available. /// Callers that require a fresh seat0 lookup should call `get_values_of_seat0` directly. pub fn get_active_username() -> String { + // Flatpak runs only inside the logged-in user's session, and Flathub builds + // cannot reach the host's loginctl. + if is_flatpak() { + return crate::username(); + } if let Some((_, username)) = get_active_user_id_name_from_cache() { return username; }