summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-10-23 12:13:00 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-10-23 12:13:29 +0200
commit234c153853d48209da5d848df437f6e8a3b198d5 (patch)
tree1998e153346915b3cff247c0e86a25604bb9564e
parent667d5b9b72ca1c22b0ca63bd8c4cf0725a19e4a2 (diff)
Avoid macOS 14 warning message when app is launched from command line
-rw-r--r--src/Fl_cocoa.mm9
1 files changed, 9 insertions, 0 deletions
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];