Added flatpak feature

Signed-off-by: sandroid <sandroid@posteo.net>
This commit is contained in:
sandroid 2022-09-10 00:44:35 +02:00
parent d8f16a523e
commit 1f591e0a66
No known key found for this signature in database
GPG Key ID: 91418C9982B8B76E
2 changed files with 6 additions and 1 deletions

View File

@ -21,6 +21,7 @@ hbbs = []
cli = []
with_rc = ["simple_rc"]
appimage = []
flatpak = []
use_samplerate = ["samplerate"]
use_rubato = ["rubato"]
use_dasp = ["dasp"]

View File

@ -93,7 +93,11 @@ pub fn start(args: &mut [String]) {
let prefix = std::env::var("APPDIR").unwrap_or("".to_string());
#[cfg(not(feature = "appimage"))]
let prefix = "".to_string();
sciter::set_library(&(prefix + "/usr/lib/rustdesk/libsciter-gtk.so")).ok();
#[cfg(feature = "flatpak")]
let dir = "/app";
#[cfg(not(feature = "flatpak"))]
let dir = "/usr";
sciter::set_library(&(prefix + dir + "/lib/rustdesk/libsciter-gtk.so")).ok();
}
// https://github.com/c-smile/sciter-sdk/blob/master/include/sciter-x-types.h
// https://github.com/rustdesk/rustdesk/issues/132#issuecomment-886069737