--- src/adw-settings-impl-macos.c 2025-10-10 02:37:48.000000000 +0800 +++ src/adw-settings-impl-macos.c 2026-05-04 22:14:30.000000000 +0800 @@ -8,6 +8,7 @@ #include "adw-settings-impl-private.h" +#include #include struct _AdwSettingsImplMacOS @@ -41,6 +42,7 @@ static AdwAccentColor get_accent_color (void) { +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 GdkRGBA rgba; NSColor *accentColor = [NSColor.controlAccentColor colorUsingColorSpace:[ NSColorSpace sRGBColorSpace]]; @@ -54,6 +56,8 @@ rgba.alpha = alpha; return adw_accent_color_nearest_from_rgba (&rgba); +#endif + return ADW_ACCENT_COLOR_BLUE; } -(void)appDidChangeAccentColor:(NSNotification *)notification @@ -65,6 +69,7 @@ static AdwSystemColorScheme get_ns_color_scheme (void) { +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; NSString *style = [userDefaults stringForKey:@"AppleInterfaceStyle"]; BOOL isDark = [style isEqualToString:@"Dark"]; @@ -72,6 +77,8 @@ return isDark ? ADW_SYSTEM_COLOR_SCHEME_PREFER_DARK : ADW_SYSTEM_COLOR_SCHEME_DEFAULT; +#endif + return ADW_SYSTEM_COLOR_SCHEME_DEFAULT; } -(void)appDidChangeTheme:(NSNotification *)notification @@ -83,7 +90,11 @@ -(void)appDidChangeHighContrast:(NSNotification *)notification { if (self->impl != NULL) { +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101000 gboolean high_contrast = [[NSWorkspace sharedWorkspace] accessibilityDisplayShouldIncreaseContrast]; +#else + gboolean high_contrast = FALSE; +#endif adw_settings_impl_set_high_contrast (self->impl, high_contrast); } } @@ -113,32 +124,35 @@ observer = [[SettingsChangedObserver alloc] initWithSettings:(AdwSettingsImpl *)self]; if (enable_accent_colors) { +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 [[NSDistributedNotificationCenter defaultCenter] addObserver:observer selector:@selector(appDidChangeAccentColor:) name:@"AppleColorPreferencesChangedNotification" object:nil]; - +#endif [observer appDidChangeAccentColor:nil]; } if (enable_high_contrast) { +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:observer selector:@selector(appDidChangeHighContrast:) name:@"NSWorkspaceAccessibilityDisplayOptionsDidChangeNotification" object:nil]; - +#endif [observer appDidChangeHighContrast:nil]; } if (enable_color_scheme) { +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 [[NSDistributedNotificationCenter defaultCenter] addObserver:observer selector:@selector(appDidChangeTheme:) name:@"AppleInterfaceThemeChangedNotification" object:nil]; - +#endif [observer appDidChangeTheme:nil]; }