From 234c153853d48209da5d848df437f6e8a3b198d5 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Mon, 23 Oct 2023 12:13:00 +0200 Subject: Avoid macOS 14 warning message when app is launched from command line --- src/Fl_cocoa.mm | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index fbbe6aebf..2331a9ff6 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -1487,6 +1487,7 @@ static FLWindowDelegate *flwindowdelegate_instance = nil; open_cb_f_type open_cb; TSMDocumentID currentDoc; } +- (BOOL)applicationSupportsSecureRestorableState:(NSApplication *)app; - (void)applicationDidFinishLaunching:(NSNotification *)notification; - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)sender; - (void)applicationDidBecomeActive:(NSNotification *)notify; @@ -1499,6 +1500,14 @@ static FLWindowDelegate *flwindowdelegate_instance = nil; @end @implementation FLAppDelegate +- (BOOL)applicationSupportsSecureRestorableState:(NSApplication *)app { + // Avoids macOS 14 warning message when app is launched from command line: + // "WARNING: Secure coding is automatically enabled for restorable state! + // However, not on all supported macOS versions of this application. + // Opt-in to secure coding explicitly by implementing + // NSApplicationDelegate.applicationSupportsSecureRestorableState:." + return (fl_mac_os_version >= 140000); +} - (void)applicationDidFinishLaunching:(NSNotification *)notification { if (fl_mac_os_version >= 101300 && [NSApp isRunning]) [NSApp stop:nil]; -- cgit v1.2.3