From b15f2a8a26734b63b2504b17e02042644333d3fc Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Fri, 2 Jan 2015 12:19:49 -0500 Subject: [PATCH] Properly invoke the default close operation when dismissing the password frame. --- .../src/main/java/com/lyndir/masterpassword/gui/AppleGUI.java | 2 +- .../src/main/java/com/lyndir/masterpassword/gui/GUI.java | 1 - .../main/java/com/lyndir/masterpassword/gui/PasswordFrame.java | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/MasterPassword/Java/masterpassword-gui/src/main/java/com/lyndir/masterpassword/gui/AppleGUI.java b/MasterPassword/Java/masterpassword-gui/src/main/java/com/lyndir/masterpassword/gui/AppleGUI.java index 82f010a4..34ae8a88 100644 --- a/MasterPassword/Java/masterpassword-gui/src/main/java/com/lyndir/masterpassword/gui/AppleGUI.java +++ b/MasterPassword/Java/masterpassword-gui/src/main/java/com/lyndir/masterpassword/gui/AppleGUI.java @@ -34,7 +34,7 @@ public class AppleGUI extends GUI { @Override protected PasswordFrame newPasswordFrame(final User user) { PasswordFrame frame = super.newPasswordFrame( user ); - frame.setDefaultCloseOperation( WindowConstants.DISPOSE_ON_CLOSE ); + frame.setDefaultCloseOperation( WindowConstants.HIDE_ON_CLOSE ); return frame; } diff --git a/MasterPassword/Java/masterpassword-gui/src/main/java/com/lyndir/masterpassword/gui/GUI.java b/MasterPassword/Java/masterpassword-gui/src/main/java/com/lyndir/masterpassword/gui/GUI.java index 98c7a899..9f03925b 100644 --- a/MasterPassword/Java/masterpassword-gui/src/main/java/com/lyndir/masterpassword/gui/GUI.java +++ b/MasterPassword/Java/masterpassword-gui/src/main/java/com/lyndir/masterpassword/gui/GUI.java @@ -21,7 +21,6 @@ import com.google.common.base.Charsets; import com.google.common.io.*; import com.lyndir.lhunath.opal.system.logging.Logger; import com.lyndir.lhunath.opal.system.util.TypeUtils; -import com.lyndir.masterpassword.MasterKey; import java.io.*; import java.net.URI; import java.net.URL; diff --git a/MasterPassword/Java/masterpassword-gui/src/main/java/com/lyndir/masterpassword/gui/PasswordFrame.java b/MasterPassword/Java/masterpassword-gui/src/main/java/com/lyndir/masterpassword/gui/PasswordFrame.java index 09f992fc..a58ce4ca 100644 --- a/MasterPassword/Java/masterpassword-gui/src/main/java/com/lyndir/masterpassword/gui/PasswordFrame.java +++ b/MasterPassword/Java/masterpassword-gui/src/main/java/com/lyndir/masterpassword/gui/PasswordFrame.java @@ -106,7 +106,7 @@ public class PasswordFrame extends JFrame implements DocumentListener { passwordField.setText( null ); siteNameField.setText( null ); - dispose(); + dispatchEvent( new WindowEvent( PasswordFrame.this, WindowEvent.WINDOW_CLOSING ) ); } } ); }