File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -922,7 +922,7 @@ elseif(APPLE)
922922 src/detection/users/users_linux.c
923923 src/detection/wallpaper/wallpaper_apple.m
924924 src/detection/wifi/wifi_apple.m
925- src/detection/wm/wm_apple.c
925+ src/detection/wm/wm_apple.m
926926 src/detection/de/de_nosupport.c
927927 src/detection/wmtheme/wmtheme_apple.m
928928 src/detection/camera/camera_apple.m
Original file line number Diff line number Diff line change 55#include " util/stringUtils.h"
66
77#include < ctype.h>
8+ #import < Foundation/Foundation.h>
89
910const char * ffDetectWMPlugin (FFstrbuf* pluginName)
1011{
@@ -39,7 +40,18 @@ const char* ffDetectWMPlugin(FFstrbuf* pluginName)
3940 return NULL ;
4041}
4142
42- const char * ffDetectWMVersion (FF_MAYBE_UNUSED const FFstrbuf * wmName , FF_MAYBE_UNUSED FFstrbuf * result , FF_MAYBE_UNUSED FFWMOptions * options )
43+ const char * ffDetectWMVersion (const FFstrbuf* wmName, FFstrbuf* result, FF_MAYBE_UNUSED FFWMOptions* options)
4344{
44- return "Not supported on this platform" ;
45+ if (!wmName)
46+ return " No WM detected" ;
47+
48+ if (ffStrbufEqualS (wmName, " WindowServer" ))
49+ {
50+ NSError * error;
51+ NSDictionary * dict = [NSDictionary dictionaryWithContentsOfURL: [NSURL URLWithString: @" file:///System/Library/CoreServices/WindowManager.app/Contents/version.plist" ]
52+ error: &error];
53+ ffStrbufInitS (result, ((NSString *) dict[@" CFBundleVersion" ]).UTF8String );
54+ }
55+
56+ return NULL ;
4557}
You can’t perform that action at this time.
0 commit comments