JAL-1988 This fixes the Quit response when user cancels the quit
authorBen Soares <bsoares@dundee.ac.uk>
Fri, 9 Nov 2018 16:44:32 +0000 (16:44 +0000)
committerBen Soares <bsoares@dundee.ac.uk>
Fri, 9 Nov 2018 16:44:32 +0000 (16:44 +0000)
src/jalview/gui/Desktop.java

index 4d00b1f..c2eb598 100644 (file)
@@ -67,6 +67,7 @@ import java.awt.desktop.PreferencesHandler;
 import java.awt.desktop.QuitEvent;
 import java.awt.desktop.QuitHandler;
 import java.awt.desktop.QuitResponse;
+import java.awt.desktop.QuitStrategy;
 import java.awt.dnd.DnDConstants;
 import java.awt.dnd.DropTargetDragEvent;
 import java.awt.dnd.DropTargetDropEvent;
@@ -395,13 +396,16 @@ public class Desktop extends jalview.jbgui.GDesktop
         {
           System.out.println("Shortcut Quit confirmed by user");
           quit();
+          r.performQuit(); // probably won't reach this line, but just in case
         }
         else
         {
+          r.cancelQuit();
           System.out.println("Shortcut Quit cancelled by user");
         }
       }
     });
+    hdesktop.setQuitStrategy(QuitStrategy.CLOSE_ALL_WINDOWS);
 
     // }