Skip to content

Commit 09ccbca

Browse files
committed
WmTheme (Apple): don't depend on displayserver detection
1 parent 4f28ae6 commit 09ccbca

File tree

2 files changed

+1
-23
lines changed

2 files changed

+1
-23
lines changed

src/detection/wmtheme/wmtheme_apple.m

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
#include "fastfetch.h"
2-
#include "detection/displayserver/displayserver.h"
32
#include "wmtheme.h"
43

54
#import <Foundation/Foundation.h>
65

7-
static bool detectQuartzCompositor(FFinstance* instance, FFstrbuf* themeOrError)
6+
bool ffDetectWmTheme(FF_MAYBE_UNUSED FFinstance* instance, FFstrbuf* themeOrError)
87
{
9-
FF_UNUSED(instance);
10-
118
NSError* error;
129
NSString* fileName = [NSString stringWithFormat:@"file://%s/Library/Preferences/.GlobalPreferences.plist", instance->state.platform.homeDir.chars];
1310
NSDictionary* dict = [NSDictionary dictionaryWithContentsOfURL:[NSURL URLWithString:fileName]
@@ -41,21 +38,3 @@ static bool detectQuartzCompositor(FFinstance* instance, FFstrbuf* themeOrError)
4138
ffStrbufAppendF(themeOrError, " (%s)", wmTheme ? wmTheme.UTF8String : "Light");
4239
return true;
4340
}
44-
45-
bool ffDetectWmTheme(FFinstance* instance, FFstrbuf* themeOrError)
46-
{
47-
const FFDisplayServerResult* wm = ffConnectDisplayServer(instance);
48-
49-
if(wm->wmPrettyName.length == 0)
50-
{
51-
ffStrbufAppendS(themeOrError, "WM Theme needs sucessfull WM detection");
52-
return false;
53-
}
54-
55-
if(ffStrbufIgnCaseCompS(&wm->wmPrettyName, "Quartz Compositor") == 0)
56-
return detectQuartzCompositor(instance, themeOrError);
57-
58-
ffStrbufAppendS(themeOrError, "Unknown WM: ");
59-
ffStrbufAppend(themeOrError, &wm->dePrettyName);
60-
return false;
61-
}

src/detection/wmtheme/wmtheme_nosupport.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "fastfetch.h"
2-
#include "detection/displayserver/displayserver.h"
32
#include "wmtheme.h"
43

54
bool ffDetectWmTheme(FFinstance* instance, FFstrbuf* themeOrError)

0 commit comments

Comments
 (0)