summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2023-10-04 10:56:05 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2023-10-05 19:40:02 +0200
commitfc1549c01445bb9c99d3ba6de8fa9da230614e72 (patch)
tree57f11bcbc4a67b81cf2e17e4f1a7f89cb8ea1d65 /src/plugins/platforms/cocoa
parent2b8e1a706e631e1a2e29f016823b11666d7f1f80 (diff)
macOS: Silence warning about supporting secure state restoration
We don't support or implement state restorations via the AppKit state restoration APIs, but if we did, we would/should support secure state restoration. This is the default for apps linked against the macOS 14 SDK, but as we target versions below that as well we need to return YES here explicitly to silence a runtime warning. Pick-to: 6.6 6.5 6.2 Fixes: QTBUG-117745 Change-Id: I0145504a79e53499852832d23dc7d4d6838dfa1b Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa')
-rw-r--r--src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
index bb7b5c3c0c..42c76e38e8 100644
--- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
+++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
@@ -329,6 +329,23 @@ QT_USE_NAMESPACE
else
QWindowSystemInterface::handleFileOpenEvent(qurlString);
}
+
+- (BOOL)applicationSupportsSecureRestorableState:(NSApplication *)application
+{
+ if (@available(macOS 12, *)) {
+ if ([reflectionDelegate respondsToSelector:_cmd])
+ return [reflectionDelegate applicationSupportsSecureRestorableState:application];
+ }
+
+ // We don't support or implement state restorations via the AppKit
+ // state restoration APIs, but if we did, we would/should support
+ // secure state restoration. This is the default for apps linked
+ // against the macOS 14 SDK, but as we target versions below that
+ // as well we need to return YES here explicitly to silence a runtime
+ // warning.
+ return YES;
+}
+
@end
@implementation QCocoaApplicationDelegate (Menus)