Skip to content

An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.

fix one flatpak feature missing

rustdeskb5f6a9c91a2d
diff --git a/Cargo.toml b/Cargo.toml
index bf404b1df..05a11d0aa 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -20,8 +20,6 @@ path = "src/naming.rs"
inline = []
cli = []
flutter_texture_render = []
-appimage = []
-flatpak = []
use_samplerate = ["samplerate"]
use_rubato = ["rubato"]
use_dasp = ["dasp"]
diff --git a/build.py b/build.py
index f233077c1..cdcf2994d 100755
--- a/build.py
+++ b/build.py
@@ -134,16 +134,6 @@ def make_parser():
action='store_true',
help='Build with unix file copy paste feature'
)
- parser.add_argument(
- '--flatpak',
- action='store_true',
- help='Build rustdesk libs with the flatpak feature enabled'
- )
- parser.add_argument(
- '--appimage',
- action='store_true',
- help='Build rustdesk libs with the appimage feature enabled'
- )
parser.add_argument(
'--skip-cargo',
action='store_true',
@@ -296,10 +286,6 @@ def get_features(args):
features.append('flutter')
if not args.disable_flutter_texture_render:
features.append('flutter_texture_render')
- if args.flatpak:
- features.append('flatpak')
- if args.appimage:
- features.append('appimage')
if args.unix_file_copy_paste:
features.append('unix-file-copy-paste')
if windows:
diff --git a/libs/hbb_common/Cargo.toml b/libs/hbb_common/Cargo.toml
index 38c02ceae..16bf3f69f 100644
--- a/libs/hbb_common/Cargo.toml
+++ b/libs/hbb_common/Cargo.toml
@@ -57,7 +57,6 @@ tokio-native-tls ="0.3"
[features]
quic = []
-flatpak = []
[build-dependencies]
protobuf-codegen = { version = "3.4" }
diff --git a/libs/hbb_common/src/platform/linux.rs b/libs/hbb_common/src/platform/linux.rs
index 7f541f084..4ad684478 100644
--- a/libs/hbb_common/src/platform/linux.rs
+++ b/libs/hbb_common/src/platform/linux.rs
@@ -223,8 +223,19 @@ pub fn run_cmds_trim_newline(cmds: &str) -> ResultType<String> {
})
}
-#[cfg(not(feature = "flatpak"))]
fn run_loginctl(args: Option<Vec<&str>>) -> std::io::Result<std::process::Output> {
+ if std::env::var("FLATPAK_ID").is_ok() {
+ let mut l_args = String::from("loginctl");
+ if let Some(a) = args {
+ l_args = format!("{} {}", l_args, a.join(" "));
+ }
+ let res = std::process::Command::new("flatpak-spawn")
+ .args(vec![String::from("--host"), l_args])
+ .output();
+ if res.is_ok() {
+ return res;
+ }
+ }
let mut cmd = std::process::Command::new("loginctl");
if let Some(a) = args {
return cmd.args(a).output();
@@ -232,17 +243,6 @@ fn run_loginctl(args: Option<Vec<&str>>) -> std::io::Result<std::process::Output
cmd.output()
}
-#[cfg(feature = "flatpak")]
-fn run_loginctl(args: Option<Vec<&str>>) -> std::io::Result<std::process::Output> {
- let mut l_args = String::from("loginctl");
- if let Some(a) = args {
- l_args = format!("{} {}", l_args, a.join(" "));
- }
- std::process::Command::new("flatpak-spawn")
- .args(vec![String::from("--host"), l_args])
- .output()
-}
-
/// forever: may not work
#[cfg(target_os = "linux")]
pub fn system_message(title: &str, msg: &str, forever: bool) -> ResultType<()> {
@@ -290,6 +290,9 @@ mod tests {
fn test_run_cmds_trim_newline() {
assert_eq!(run_cmds_trim_newline("echo -n 123").unwrap(), "123");
assert_eq!(run_cmds_trim_newline("echo 123").unwrap(), "123");
- assert_eq!(run_cmds_trim_newline("whoami").unwrap() + "\n", run_cmds("whoami").unwrap());
+ assert_eq!(
+ run_cmds_trim_newline("whoami").unwrap() + "\n",
+ run_cmds("whoami").unwrap()
+ );
}
}