Skip to content

Commit

Permalink
Merge branch 'rustdesk:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangbo8418 authored Oct 6, 2024
2 parents 66aa6b8 + e7353be commit 2c43c77
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/ipc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ pub struct ClipboardNonFile {
pub height: i32,
// message.proto: ClipboardFormat
pub format: i32,
pub special_name: String,
}

#[cfg(not(any(target_os = "android", target_os = "ios")))]
Expand Down
9 changes: 9 additions & 0 deletions src/platform/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,17 @@ pub fn get_env_var(k: &str) -> String {
}
}

fn is_flatpak() -> bool {
std::env::var("FLATPAK_SANDBOX_DIR").is_ok() ||
std::env::var("FLATPAK_ID").is_ok() ||
std::env::var("FLATPAK_SESSION_BUS_ADDRESS").is_ok()
}

// Headless is enabled, always return true.
pub fn is_prelogin() -> bool {
if is_flatpak() {
return false;
}
let n = get_active_userid().len();
n < 4 && n > 1
}
Expand Down
1 change: 1 addition & 0 deletions src/server/clipboard_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ impl Handler {
format: ClipboardFormat::from_i32(c.format)
.unwrap_or(ClipboardFormat::Text)
.into(),
special_name: c.special_name,
..Default::default()
})
.collect(),
Expand Down
1 change: 1 addition & 0 deletions src/ui_cm_interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,7 @@ impl<T: InvokeUiCM> IpcTaskRunner<T> {
width: c.width,
height: c.height,
format: c.format.value(),
special_name: c.special_name,
});
}
allow_err!(self.stream.send(&Data::ClipboardNonFile(Some(("".to_owned(), main_data)))).await);
Expand Down

0 comments on commit 2c43c77

Please sign in to comment.