diff --git a/macos/src/main/objcpp/DarkMode.mm b/macos/src/main/objcpp/DarkMode.mm index fc115abf..b141df22 100644 --- a/macos/src/main/objcpp/DarkMode.mm +++ b/macos/src/main/objcpp/DarkMode.mm @@ -175,8 +175,10 @@ BOOL isDarkModeMojave() { CFPreferencesGetAppBooleanValue(NSRequiresAquaSystemAppearance, bundleName, &exists); isPatched = exists ? YES : NO; - CFPreferencesSetAppValue(NSRequiresAquaSystemAppearance, kCFBooleanFalse, bundleName); - CFPreferencesAppSynchronize(bundleName); + if (!isPatched) { + CFPreferencesSetAppValue(NSRequiresAquaSystemAppearance, kCFBooleanFalse, bundleName); + CFPreferencesAppSynchronize(bundleName); + } } } else { isPatched = false;