=> 73d9c1d6f0dee5b391ec0484d62638c087f2adf7
[1mdiff --git a/src/macos.m b/src/macos.m[m [1mindex b000fed9..975ba928 100644[m [1m--- a/src/macos.m[m [1m+++ b/src/macos.m[m [36m@@ -38,6 +38,16 @@[m [menum iTouchBarVariant {[m default_TouchBarVariant,[m };[m [m [32m+[m[32mstatic NSString *currentSystemAppearance_(void) {[m [32m+[m[32m /* This API does not exist on 10.13. */[m [32m+[m[32m @try {[m [32m+[m[32m return [[NSApp effectiveAppearance] name];[m [32m+[m[32m }[m [32m+[m[32m @catch (NSException *) {[m [32m+[m[32m return @"NSAppearanceNameAqua";[m [32m+[m[32m }[m [32m+[m[32m}[m [32m+[m /*----------------------------------------------------------------------------------------------*/[m [m @interface CommandButton : NSCustomTouchBarItem {[m [36m@@ -447,7 +457,11 @@[m [mvoid setupApplication_MacOS(void) {[m NSApplication *app = [NSApplication sharedApplication];[m /* Our delegate will override SDL's delegate. */[m MyDelegate *myDel = [[MyDelegate alloc] initWithSDLDelegate:app.delegate];[m [31m- [myDel setAppearance:[[app effectiveAppearance] name]];[m [32m+[m[32m [myDel setAppearance:currentSystemAppearance_()];[m [32m+[m[32m [app addObserver:myDel[m [32m+[m[32m forKeyPath:@"effectiveAppearance"[m [32m+[m[32m options:0[m [32m+[m[32m context:myDel];[m app.delegate = myDel;[m NSMenu *appMenu = [[[NSApp mainMenu] itemAtIndex:0] submenu];[m NSMenuItem *prefsItem = [appMenu itemWithTitle:@"Preferences…"];[m [36m@@ -463,10 +477,6 @@[m [mvoid setupApplication_MacOS(void) {[m void insertMenuItems_MacOS(const char *menuLabel, int atIndex, const iMenuItem *items, size_t count) {[m NSApplication *app = [NSApplication sharedApplication];[m MyDelegate *myDel = (MyDelegate *) app.delegate;[m [31m- [app addObserver:myDel[m [31m- forKeyPath:@"effectiveAppearance"[m [31m- options:0[m [31m- context:myDel];[m NSMenu *appMenu = [app mainMenu];[m NSMenuItem *mainItem = [appMenu insertItemWithTitle:[NSString stringWithUTF8String:menuLabel][m action:nil[m [36m@@ -525,7 +535,7 @@[m [mvoid insertMenuItems_MacOS(const char *menuLabel, int atIndex, const iMenuItem *[m void handleCommand_MacOS(const char *cmd) {[m if (equal_Command(cmd, "prefs.ostheme.changed")) {[m if (arg_Command(cmd)) {[m [31m- appearanceChanged_MacOS_([[NSApp effectiveAppearance] name]);[m [32m+[m[32m appearanceChanged_MacOS_(currentSystemAppearance_());[m }[m }[m #if 0[m
text/gemini; charset=utf-8
This content has been proxied by September (ba2dc).