summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2015-12-05 22:24:02 -0800
committerMinh Nguyễn <mxn@1ec5.org>2015-12-13 17:26:53 -0800
commitb869d3c820de8c76f3b09ce75a438062e6416891 (patch)
treecd2e95aaf22d597ef04fcf07146d1086d5e34579
parent0fb2b855a4539803f42a4048257da606f66d9f4e (diff)
downloadqtlocation-mapboxgl-b869d3c820de8c76f3b09ce75a438062e6416891.tar.gz
[osx] Persist viewpoint across relaunch
-rw-r--r--platform/osx/app/AppDelegate.m8
1 files changed, 8 insertions, 0 deletions
diff --git a/platform/osx/app/AppDelegate.m b/platform/osx/app/AppDelegate.m
index 094260f8d8..cae27b0c60 100644
--- a/platform/osx/app/AppDelegate.m
+++ b/platform/osx/app/AppDelegate.m
@@ -57,6 +57,14 @@ static NSString * const MGLDroppedPinAnnotationImageIdentifier = @"dropped";
andSelector:@selector(handleGetURLEvent:withReplyEvent:)
forEventClass:kInternetEventClass
andEventID:kAEGetURL];
+
+ // Normally, an application should respect the “Close windows when quitting
+ // an application” setting in the General pane of System Preferences. But
+ // the map would only be restored to its last opened location if the user
+ // quits the application using Quit and Keep Windows. An application that
+ // displays only a map should restore the last viewed map, like Maps.app
+ // does.
+ [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"NSQuitAlwaysKeepsWindows"];
}
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {