mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-10-19 16:17:03 +00:00
fix(linux): report the process user as the active user under Flatpak (#16519)
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 Claude-Session: https://claude.ai/code/session_01WS1HTjp6UQuG43KEcQPq1R Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
67090d3aa1
commit
4411d10f45
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user