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

@@ -35,6 +35,10 @@ type Xdo = *const c_void;
pub const PA_SAMPLE_RATE: u32 = 48000;
static mut UNMODIFIED: bool = true;
lazy_static::lazy_static! {
pub static ref IS_X11: bool = hbb_common::platform::linux::is_x11_or_headless();
}
thread_local! {
static XDO: RefCell<Xdo> = RefCell::new(unsafe { xdo_new(std::ptr::null()) });
static DISPLAY: RefCell<*mut c_void> = RefCell::new(unsafe { XOpenDisplay(std::ptr::null())});
@@ -1360,3 +1364,8 @@ impl Drop for WallPaperRemover {
}
}
}
#[inline]
pub fn is_x11() -> bool {
*IS_X11
}