fix is x11, on conn

Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
dignow
2023-10-21 13:10:51 +08:00
parent aa3c58917b
commit b3948910ff
7 changed files with 36 additions and 43 deletions

View File

@@ -108,7 +108,7 @@ impl Drop for SimpleCallOnReturn {
pub fn global_init() -> bool {
#[cfg(target_os = "linux")]
{
if !*IS_X11 {
if !crate::platform::linux::is_x11() {
crate::server::wayland::init();
}
}
@@ -956,7 +956,10 @@ pub async fn post_request_sync(url: String, body: String, header: &str) -> Resul
}
#[inline]
pub fn make_privacy_mode_msg_with_details(state: back_notification::PrivacyModeState, details: String) -> Message {
pub fn make_privacy_mode_msg_with_details(
state: back_notification::PrivacyModeState,
details: String,
) -> Message {
let mut misc = Misc::new();
let mut back_notification = BackNotification {
details,
@@ -990,17 +993,6 @@ pub fn get_supported_keyboard_modes(version: i64) -> Vec<KeyboardMode> {
.collect::<Vec<_>>()
}
#[cfg(not(target_os = "linux"))]
lazy_static::lazy_static! {
pub static ref IS_X11: bool = false;
}
#[cfg(target_os = "linux")]
lazy_static::lazy_static! {
pub static ref IS_X11: bool = hbb_common::platform::linux::is_x11_or_headless();
}
pub fn make_fd_to_json(id: i32, path: String, entries: &Vec<FileEntry>) -> String {
use serde_json::json;
let mut fd_json = serde_json::Map::new();