diff --git a/src/ipc.rs b/src/ipc.rs index 9815fdb748bb..c7243d821708 100644 --- a/src/ipc.rs +++ b/src/ipc.rs @@ -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")))] diff --git a/src/platform/linux.rs b/src/platform/linux.rs index 9c549423045d..3f0860f868e5 100644 --- a/src/platform/linux.rs +++ b/src/platform/linux.rs @@ -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 } diff --git a/src/server/clipboard_service.rs b/src/server/clipboard_service.rs index 55ebbc2f2ec5..3aadb3ad5dd2 100644 --- a/src/server/clipboard_service.rs +++ b/src/server/clipboard_service.rs @@ -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(), diff --git a/src/ui_cm_interface.rs b/src/ui_cm_interface.rs index 549798a51728..c34e15e26c84 100644 --- a/src/ui_cm_interface.rs +++ b/src/ui_cm_interface.rs @@ -512,6 +512,7 @@ impl IpcTaskRunner { 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);