fix mac tray icon to use template icon, no need to know theme any more

This commit is contained in:
rustdesk
2024-02-16 12:29:32 +08:00
parent 51c603a3a6
commit f7f3bc8bee
5 changed files with 273 additions and 206 deletions

View File

@@ -13,6 +13,11 @@ extern "C" bool CanUseNewApiForScreenCaptureCheck() {
#endif
}
extern "C" uint32_t majorVersion() {
NSOperatingSystemVersion version = [[NSProcessInfo processInfo] operatingSystemVersion];
return version.majorVersion;
}
extern "C" bool IsCanScreenRecording(bool prompt) {
#ifdef NO_InputMonitoringAuthStatus
return false;
@@ -113,7 +118,7 @@ extern "C" float BackingScaleFactor() {
// https://github.com/jhford/screenresolution/blob/master/cg_utils.c
// https://github.com/jdoupe/screenres/blob/master/setgetscreen.m
size_t bitDepth(CGDisplayModeRef mode) {
size_t bitDepth(CGDisplayModeRef mode) {
size_t depth = 0;
// Deprecated, same display same bpp?
// https://stackoverflow.com/questions/8210824/how-to-avoid-cgdisplaymodecopypixelencoding-to-get-bpp

View File

@@ -45,10 +45,15 @@ extern "C" {
max: u32,
numModes: *mut u32,
) -> BOOL;
fn majorVersion() -> u32;
fn MacGetMode(display: u32, width: *mut u32, height: *mut u32) -> BOOL;
fn MacSetMode(display: u32, width: u32, height: u32) -> BOOL;
}
pub fn major_version() -> u32 {
unsafe { majorVersion() }
}
pub fn is_process_trusted(prompt: bool) -> bool {
unsafe {
let value = if prompt { YES } else { NO };