From b869d3c820de8c76f3b09ce75a438062e6416891 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Sat, 5 Dec 2015 22:24:02 -0800 Subject: [PATCH] [osx] Persist viewpoint across relaunch --- platform/osx/app/AppDelegate.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/platform/osx/app/AppDelegate.m b/platform/osx/app/AppDelegate.m index 094260f8d..cae27b0c6 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 {