mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-11 06:27:13 -06:00
Window decorations: window top border on Windows 10 in "full window content" mode was not fully repainted when activating or deactivating window (issue #809)
This commit is contained in:
@@ -9,6 +9,12 @@ FlatLaf Change Log
|
|||||||
- Popup: Fixed flicker of popups (e.g. tooltips) while they are moving (e.g.
|
- Popup: Fixed flicker of popups (e.g. tooltips) while they are moving (e.g.
|
||||||
following mouse pointer). (issues #832 and #672)
|
following mouse pointer). (issues #832 and #672)
|
||||||
|
|
||||||
|
#### Fixed bugs
|
||||||
|
|
||||||
|
- FlatLaf window decorations: Window top border on Windows 10 in "full window
|
||||||
|
content" mode was not fully repainted when activating or deactivating window.
|
||||||
|
(issue #809)
|
||||||
|
|
||||||
#### Incompatibilities
|
#### Incompatibilities
|
||||||
|
|
||||||
- ProgressBar: Log warning (including stack trace) when uninstalling
|
- ProgressBar: Log warning (including stack trace) when uninstalling
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ public class FlatTitlePane
|
|||||||
windowTopBorderLayer = new JPanel();
|
windowTopBorderLayer = new JPanel();
|
||||||
windowTopBorderLayer.setVisible( false );
|
windowTopBorderLayer.setVisible( false );
|
||||||
windowTopBorderLayer.setOpaque( false );
|
windowTopBorderLayer.setOpaque( false );
|
||||||
windowTopBorderLayer.setBorder( FlatUIUtils.nonUIResource( FlatNativeWindowBorder.WindowTopBorder.getInstance() ) );
|
windowTopBorderLayer.setBorder( FlatUIUtils.nonUIResource( WindowTopBorder.getInstance() ) );
|
||||||
} else
|
} else
|
||||||
windowTopBorderLayer = null;
|
windowTopBorderLayer = null;
|
||||||
|
|
||||||
@@ -745,16 +745,6 @@ public class FlatTitlePane
|
|||||||
g.fillRect( 0, 0, getWidth(), getHeight() );
|
g.fillRect( 0, 0, getWidth(), getHeight() );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void repaintWindowBorder() {
|
|
||||||
int width = rootPane.getWidth();
|
|
||||||
int height = rootPane.getHeight();
|
|
||||||
Insets insets = rootPane.getInsets();
|
|
||||||
rootPane.repaint( 0, 0, width, insets.top ); // top
|
|
||||||
rootPane.repaint( 0, 0, insets.left, height ); // left
|
|
||||||
rootPane.repaint( 0, height - insets.bottom, width, insets.bottom ); // bottom
|
|
||||||
rootPane.repaint( width - insets.right, 0, insets.right, height ); // right
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Iconifies the window.
|
* Iconifies the window.
|
||||||
*/
|
*/
|
||||||
@@ -1352,10 +1342,7 @@ public class FlatTitlePane
|
|||||||
activeChanged( true );
|
activeChanged( true );
|
||||||
updateNativeTitleBarHeightAndHitTestSpots();
|
updateNativeTitleBarHeightAndHitTestSpots();
|
||||||
|
|
||||||
if( isWindowTopBorderNeeded() )
|
repaintBorder();
|
||||||
WindowTopBorder.getInstance().repaintBorder( FlatTitlePane.this );
|
|
||||||
|
|
||||||
repaintWindowBorder();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1363,10 +1350,22 @@ public class FlatTitlePane
|
|||||||
activeChanged( false );
|
activeChanged( false );
|
||||||
updateNativeTitleBarHeightAndHitTestSpots();
|
updateNativeTitleBarHeightAndHitTestSpots();
|
||||||
|
|
||||||
if( isWindowTopBorderNeeded() )
|
repaintBorder();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void repaintBorder() {
|
||||||
|
// Windows 10 top border
|
||||||
|
if( windowTopBorderLayer != null && windowTopBorderLayer.isShowing())
|
||||||
|
WindowTopBorder.getInstance().repaintBorder( windowTopBorderLayer );
|
||||||
|
else if( isWindowTopBorderNeeded() && !isWindowMaximized() && !isFullWindowContent() )
|
||||||
WindowTopBorder.getInstance().repaintBorder( FlatTitlePane.this );
|
WindowTopBorder.getInstance().repaintBorder( FlatTitlePane.this );
|
||||||
|
|
||||||
repaintWindowBorder();
|
// Window border used for non-native window decorations
|
||||||
|
if( rootPane.getBorder() instanceof FlatRootPaneUI.FlatWindowBorder ) {
|
||||||
|
// not repainting four areas on the four sides because RepaintManager
|
||||||
|
// unions dirty regions, which also results in repaint of whole rootpane
|
||||||
|
rootPane.repaint();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user