From 2a82009ffeb4fe22ebe7ba13791bba7906e2db83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Wed, 21 Jan 2026 09:39:31 +0800 Subject: [PATCH] WM (macOS): checks the version of WindowServer instead of WindowManager --- src/detection/wm/wm_apple.m | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/detection/wm/wm_apple.m b/src/detection/wm/wm_apple.m index 6f595e467..2036cfd12 100644 --- a/src/detection/wm/wm_apple.m +++ b/src/detection/wm/wm_apple.m @@ -50,9 +50,16 @@ const char* ffDetectWMVersion(const FFstrbuf* wmName, FFstrbuf* result, FF_MAYBE if (ffStrbufEqualS(wmName, "WindowServer")) { NSError* error; - NSDictionary* dict = [NSDictionary dictionaryWithContentsOfURL:[NSURL URLWithString:@"file:///System/Library/CoreServices/WindowManager.app/Contents/version.plist"] + NSDictionary* dict = [NSDictionary dictionaryWithContentsOfURL:[NSURL URLWithString:@"file:///System/Library/PrivateFrameworks/SkyLight.framework/Resources/version.plist"] error:&error]; - ffStrbufInitS(result, ((NSString*) dict[@"CFBundleVersion"]).UTF8String); + if (!dict) + { + dict = [NSDictionary dictionaryWithContentsOfURL:[NSURL URLWithString:@"file:///System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Resources/version.plist"] + error:&error]; + } + + if (dict) + ffStrbufInitS(result, ((NSString*) dict[@"CFBundleShortVersionString"]).UTF8String); } return NULL;