OSDN Git Service

Adopted change from Angband: don't change the window visibility because a window...
authorEric Branlund <ebranlund@fastmail.com>
Fri, 6 Mar 2020 23:14:31 +0000 (15:14 -0800)
committerEric Branlund <ebranlund@fastmail.com>
Fri, 6 Mar 2020 23:14:31 +0000 (15:14 -0800)
src/main-cocoa.m

index 620fe3d..73b9aff 100644 (file)
@@ -2300,7 +2300,13 @@ static __strong NSFont* gDefaultFont = nil;
 
 - (void)windowWillClose: (NSNotification *)notification
 {
+    /*
+     * If closing only because the application is terminating, don't update
+     * the visible state for when the application is relaunched.
+     */
+    if (! quit_when_ready) {
        [self saveWindowVisibleToDefaults: NO];
+    }
 }
 
 @end
@@ -4780,6 +4786,7 @@ static void play_sound(int event)
 {
     if (p_ptr->playing == FALSE || game_is_finished == TRUE)
     {
+        quit_when_ready = true;
         return NSTerminateNow;
     }
     else if (! inkey_flag)