mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-08 06:50:56 +03:00
Window decorations: fixed maximized window bounds with Java 11.0.8 and 13.0.4, which has fixes backported from Java 15 (issue #129)
This commit is contained in:
@@ -472,7 +472,7 @@ public class FlatTitlePane
|
|||||||
int maximizedWidth = screenBounds.width;
|
int maximizedWidth = screenBounds.width;
|
||||||
int maximizedHeight = screenBounds.height;
|
int maximizedHeight = screenBounds.height;
|
||||||
|
|
||||||
if( !SystemInfo.isJava_15_orLater ) {
|
if( !isMaximizedBoundsFixed() ) {
|
||||||
// on Java 8 to 14, maximized x,y are 0,0 based on all screens in a multi-screen environment
|
// on Java 8 to 14, maximized x,y are 0,0 based on all screens in a multi-screen environment
|
||||||
maximizedX = 0;
|
maximizedX = 0;
|
||||||
maximizedY = 0;
|
maximizedY = 0;
|
||||||
@@ -509,6 +509,21 @@ public class FlatTitlePane
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Frame.setMaximizedBounds() behaves different on some Java versions after issues
|
||||||
|
* https://bugs.openjdk.java.net/browse/JDK-8231564 and
|
||||||
|
* https://bugs.openjdk.java.net/browse/JDK-8176359
|
||||||
|
* (see also https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8176359)
|
||||||
|
* were fixed in Java 15 and backported to 11.0.8 and 13.0.4.
|
||||||
|
*/
|
||||||
|
private boolean isMaximizedBoundsFixed() {
|
||||||
|
return SystemInfo.isJava_15_orLater ||
|
||||||
|
(SystemInfo.javaVersion >= SystemInfo.toVersion( 11, 0, 8, 0 ) &&
|
||||||
|
SystemInfo.javaVersion < SystemInfo.toVersion( 12, 0, 0, 0 )) ||
|
||||||
|
(SystemInfo.javaVersion >= SystemInfo.toVersion( 13, 0, 4, 0 ) &&
|
||||||
|
SystemInfo.javaVersion < SystemInfo.toVersion( 14, 0, 0, 0 ));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Restores the window size.
|
* Restores the window size.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user