mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-11 14:37:13 -06:00
Native window decorations: fixed broken maximizing window (under special conditions) when restoring frame state at startup (issue #283)
This commit is contained in:
@@ -312,16 +312,7 @@ class FlatWindowsNativeWindowBorder
|
||||
return;
|
||||
|
||||
// remove the OS window title bar
|
||||
if( window instanceof JFrame && ((JFrame)window).getExtendedState() != 0 ) {
|
||||
// In case that the frame should be maximized or minimized immediately
|
||||
// when showing, then it is necessary to defer ::SetWindowPos() invocation.
|
||||
// Otherwise the frame will not be maximized or minimized.
|
||||
// This occurs only if frame.pack() was no invoked.
|
||||
EventQueue.invokeLater( () -> {
|
||||
updateFrame( hwnd );
|
||||
});
|
||||
} else
|
||||
updateFrame( hwnd );
|
||||
updateFrame( hwnd, (window instanceof JFrame) ? ((JFrame)window).getExtendedState() : 0 );
|
||||
}
|
||||
|
||||
void uninstall() {
|
||||
@@ -333,7 +324,7 @@ class FlatWindowsNativeWindowBorder
|
||||
|
||||
private native long installImpl( Window window );
|
||||
private native void uninstallImpl( long hwnd );
|
||||
private native void updateFrame( long hwnd );
|
||||
private native void updateFrame( long hwnd, int state );
|
||||
private native void showWindow( long hwnd, int cmd );
|
||||
|
||||
// invoked from native code
|
||||
|
||||
Reference in New Issue
Block a user