Skip to content

Commit

Permalink
Only patch if not already patched previously.
Browse files Browse the repository at this point in the history
  • Loading branch information
weisJ committed May 10, 2020
1 parent 9d43326 commit ea4773d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions macos/src/main/objcpp/DarkMode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ea4773d

Please sign in to comment.