mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-10 22:17:13 -06:00
Native window decorations: avoid double window title bar if enabling native window border failed (issue #315)
This commit is contained in:
@@ -125,6 +125,10 @@ public class FlatNativeWindowBorder
|
||||
// enable native window border for window
|
||||
setHasCustomDecoration( frame, true );
|
||||
|
||||
// avoid double window title bar if enabling native window border failed
|
||||
if( !hasCustomDecoration( frame ) )
|
||||
return;
|
||||
|
||||
// enable Swing window decoration
|
||||
rootPane.setWindowDecorationStyle( JRootPane.FRAME );
|
||||
|
||||
@@ -143,6 +147,10 @@ public class FlatNativeWindowBorder
|
||||
// enable native window border for window
|
||||
setHasCustomDecoration( dialog, true );
|
||||
|
||||
// avoid double window title bar if enabling native window border failed
|
||||
if( !hasCustomDecoration( dialog ) )
|
||||
return;
|
||||
|
||||
// enable Swing window decoration
|
||||
rootPane.setWindowDecorationStyle( JRootPane.PLAIN_DIALOG );
|
||||
}
|
||||
|
||||
@@ -308,6 +308,8 @@ class FlatWindowsNativeWindowBorder
|
||||
this.window = window;
|
||||
|
||||
hwnd = installImpl( window );
|
||||
if( hwnd == 0 )
|
||||
return;
|
||||
|
||||
// remove the OS window title bar
|
||||
if( window instanceof JFrame && ((JFrame)window).getExtendedState() != 0 ) {
|
||||
|
||||
Reference in New Issue
Block a user