Compare commits

...

2 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
1274935106 Fix macOS build: Remove @available check causing linker error
The @available check in GetDisplayName was causing the linker to look for
__isPlatformVersionAtLeast symbol which is not available when targeting
macOS 10.14. Since this function is only used for logging, we simplify it
to return "Unknown" for all displays, avoiding the runtime availability check.

Co-authored-by: rustdesk <71636191+rustdesk@users.noreply.github.com>
2026-01-28 08:49:42 +00:00
copilot-swe-agent[bot]
85b3ed5276 Initial plan 2026-01-28 08:47:32 +00:00

View File

@@ -359,22 +359,11 @@ static std::string GetDisplayUUID(CGDirectDisplayID displayId) {
// Helper function to get display name from DisplayID
static std::string GetDisplayName(CGDirectDisplayID displayId) {
NSArray<NSScreen *> *screens = [NSScreen screens];
for (NSScreen *screen in screens) {
NSDictionary *deviceDescription = [screen deviceDescription];
NSNumber *screenNumber = [deviceDescription objectForKey:@"NSScreenNumber"];
CGDirectDisplayID screenDisplayID = [screenNumber unsignedIntValue];
if (screenDisplayID == displayId) {
// localizedName is available on macOS 10.15+
if (@available(macOS 10.15, *)) {
NSString *name = [screen localizedName];
if (name) {
return std::string([name UTF8String]);
}
}
break;
}
}
// Note: NSScreen.localizedName is only available on macOS 10.15+
// Since we target 10.14, we avoid using @available checks that would
// require __isPlatformVersionAtLeast runtime function.
// For now, we just return "Unknown" for all displays.
// This is only used for logging purposes, so it doesn't affect functionality.
return "Unknown";
}