From 73d9c1d6f0dee5b391ec0484d62638c087f2adf7 Mon Sep 17 00:00:00 2001

From: =?UTF-8?q?Jaakko=20Ker=C3=A4nen?= jaakko.keranen@iki.fi

Date: Sun, 27 Sep 2020 13:33:54 +0300

Subject: [PATCH 1/1] macOS: Robust system appearance check

This API does not exist on 10.13, so prepare for an exception.


src/macos.m | 22 ++++++++++++++++------

1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/src/macos.m b/src/macos.m

index b000fed9..975ba928 100644

--- a/src/macos.m

+++ b/src/macos.m

@@ -38,6 +38,16 @@ enum iTouchBarVariant {

 default_TouchBarVariant,

};

+static NSString *currentSystemAppearance_(void) {

+}

/----------------------------------------------------------------------------------------------/

@interface CommandButton : NSCustomTouchBarItem {

@@ -447,7 +457,11 @@ void setupApplication_MacOS(void) {

 NSApplication *app = [NSApplication sharedApplication];

 /* Our delegate will override SDL's delegate. */

 MyDelegate *myDel = [[MyDelegate alloc] initWithSDLDelegate:app.delegate];

 app.delegate = myDel;

 NSMenu *appMenu = [[[NSApp mainMenu] itemAtIndex:0] submenu];

 NSMenuItem *prefsItem = [appMenu itemWithTitle:@"Preferences…"];

@@ -463,10 +477,6 @@ void setupApplication_MacOS(void) {

void insertMenuItems_MacOS(const char *menuLabel, int atIndex, const iMenuItem *items, size_t count) {

 NSApplication *app = [NSApplication sharedApplication];

 MyDelegate *myDel = (MyDelegate *) app.delegate;

 NSMenu *appMenu = [app mainMenu];

 NSMenuItem *mainItem = [appMenu insertItemWithTitle:[NSString stringWithUTF8String:menuLabel]

                                              action:nil

@@ -525,7 +535,7 @@ void insertMenuItems_MacOS(const char *menuLabel, int atIndex, const iMenuItem *

void handleCommand_MacOS(const char *cmd) {

 if (equal_Command(cmd, "prefs.ostheme.changed")) {

     if (arg_Command(cmd)) {

     }

 }

#if 0

--

2.25.1

Proxy Information
Original URL
gemini://git.skyjake.fi/lagrange/work%2Fv1.8/patch/73d9c1d6f0dee5b391ec0484d62638c087f2adf7.patch
Status Code
Success (20)
Meta
text/plain
Capsule Response Time
324.277375 milliseconds
Gemini-to-HTML Time
1.702361 milliseconds

This content has been proxied by September (3851b).