mirror of
https://github.com/Ryujinx/SDL.git
synced 2024-12-23 07:35:38 +00:00
cocoa: Use -[NSApplicationDelegate applicationSupportsSecureRestorableState]
.
This prevents warnings at startup on macOS Sonoma (14.0).
This commit is contained in:
parent
3fbaf737ef
commit
7d25a443c4
|
@ -138,6 +138,7 @@ static void Cocoa_DispatchEvent(NSEvent *theEvent)
|
||||||
|
|
||||||
- (id)init;
|
- (id)init;
|
||||||
- (void)localeDidChange:(NSNotification *)notification;
|
- (void)localeDidChange:(NSNotification *)notification;
|
||||||
|
- (BOOL)applicationSupportsSecureRestorableState:(NSApplication *)app;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation SDLAppDelegate : NSObject
|
@implementation SDLAppDelegate : NSObject
|
||||||
|
@ -310,6 +311,22 @@ static void Cocoa_DispatchEvent(NSEvent *theEvent)
|
||||||
SDL_SendDropComplete(NULL);
|
SDL_SendDropComplete(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL)applicationSupportsSecureRestorableState:(NSApplication *)app
|
||||||
|
{
|
||||||
|
// This just tells Cocoa that we didn't do any custom save state magic for the app,
|
||||||
|
// so the system is safe to use NSSecureCoding internally, instead of using unencrypted
|
||||||
|
// save states for backwards compatibility. If we don't return YES here, we'll get a
|
||||||
|
// warning on the console at startup:
|
||||||
|
//
|
||||||
|
// ```
|
||||||
|
// WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES.
|
||||||
|
// ```
|
||||||
|
//
|
||||||
|
// More-detailed explanation:
|
||||||
|
// https://stackoverflow.com/questions/77283578/sonoma-and-nsapplicationdelegate-applicationsupportssecurerestorablestate/77320845#77320845
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
static SDLAppDelegate *appDelegate = nil;
|
static SDLAppDelegate *appDelegate = nil;
|
||||||
|
|
Loading…
Reference in a new issue