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.setAlwaysOnTop( true );
|
||||||
frame.setVisible( true );
|
frame.setVisible( true );
|
||||||
frame.setExtendedState( Frame.NORMAL );
|
|
||||||
Platform.get().requestForeground();
|
Platform.get().requestForeground();
|
||||||
frame.setAlwaysOnTop( false );
|
frame.setAlwaysOnTop( false );
|
||||||
|
frame.restore();
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,8 +65,10 @@ public class JDK9Platform implements IPlatform {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean requestForeground() {
|
public boolean requestForeground() {
|
||||||
desktop.requestForeground( true );
|
final boolean supported = desktop.isSupported(Desktop.Action.APP_REQUEST_FOREGROUND);
|
||||||
return true;
|
if (supported)
|
||||||
|
desktop.requestForeground( true );
|
||||||
|
return supported;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -38,6 +38,17 @@ public class MasterPasswordFrame extends JFrame {
|
|||||||
userPanel.add( userContent.getUserToolbar(), BorderLayout.LINE_START );
|
userPanel.add( userContent.getUserToolbar(), BorderLayout.LINE_START );
|
||||||
userPanel.add( userContent.getSiteToolbar(), BorderLayout.LINE_END );
|
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();
|
final MPGuiConfig config = MPGuiConfig.get();
|
||||||
|
|
||||||
if (config.getWindowSize() != null) {
|
if (config.getWindowSize() != null) {
|
||||||
@ -58,13 +69,6 @@ public class MasterPasswordFrame extends JFrame {
|
|||||||
|
|
||||||
if (config.getWindowMaximized())
|
if (config.getWindowMaximized())
|
||||||
setExtendedState(MAXIMIZED_BOTH);
|
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