Java Client: Fix window restore after close to background in Windows
This commit is contained in:
parent
e9ad781ebe
commit
8300d48b66
@ -91,9 +91,9 @@ public final class MasterPassword {
|
||||
|
||||
frame.setAlwaysOnTop( true );
|
||||
frame.setVisible( true );
|
||||
frame.setExtendedState( Frame.NORMAL );
|
||||
Platform.get().requestForeground();
|
||||
frame.setAlwaysOnTop( false );
|
||||
frame.restore();
|
||||
} );
|
||||
}
|
||||
|
||||
|
@ -65,8 +65,10 @@ public class JDK9Platform implements IPlatform {
|
||||
|
||||
@Override
|
||||
public boolean requestForeground() {
|
||||
desktop.requestForeground( true );
|
||||
return true;
|
||||
final boolean supported = desktop.isSupported(Desktop.Action.APP_REQUEST_FOREGROUND);
|
||||
if (supported)
|
||||
desktop.requestForeground( true );
|
||||
return supported;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -38,6 +38,17 @@ public class MasterPasswordFrame extends JFrame {
|
||||
userPanel.add( userContent.getUserToolbar(), BorderLayout.LINE_START );
|
||||
userPanel.add( userContent.getSiteToolbar(), BorderLayout.LINE_END );
|
||||
|
||||
restore();
|
||||
|
||||
final WindowHandler windowHandler = new WindowHandler();
|
||||
addWindowListener(windowHandler);
|
||||
addWindowStateListener(windowHandler);
|
||||
KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(windowHandler);
|
||||
addComponentListener(new ResizeHandler());
|
||||
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
|
||||
}
|
||||
|
||||
public void restore() {
|
||||
final MPGuiConfig config = MPGuiConfig.get();
|
||||
|
||||
if (config.getWindowSize() != null) {
|
||||
@ -58,13 +69,6 @@ public class MasterPasswordFrame extends JFrame {
|
||||
|
||||
if (config.getWindowMaximized())
|
||||
setExtendedState(MAXIMIZED_BOTH);
|
||||
|
||||
final WindowHandler windowHandler = new WindowHandler();
|
||||
addWindowListener(windowHandler);
|
||||
addWindowStateListener(windowHandler);
|
||||
KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(windowHandler);
|
||||
addComponentListener(new ResizeHandler());
|
||||
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user