Skip to content

Commit 188de93

Browse files
committed
Linux with OpenJDK Project Wakefield (e.g. JetBrains JBR 25) and VM option -Dawt.toolkit.name=WLToolkit (issue #1107):
- disabled FlatLaf window decorations because of bug https://youtrack.jetbrains.com/issue/JBR-10322 - disabled System File Chooser because application hangs after closing it
1 parent f200a02 commit 188de93

4 files changed

Lines changed: 19 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ FlatLaf Change Log
1616
- Linux with JetBrains Runtime: Fixed mouse "jumping" to other position when
1717
moving window on scaled secondary screen, if using FlatLaf window decorations.
1818
(issue #1103)
19+
- Linux with OpenJDK Project Wakefield (e.g. JetBrains JBR 25) and VM option
20+
`-Dawt.toolkit.name=WLToolkit` (issue #1107):
21+
- Disabled FlatLaf window decorations because of bug
22+
[JBR-10322](https://youtrack.jetbrains.com/issue/JBR-10322).
23+
- Disabled System File Chooser because application hangs after closing it.
24+
Uses `JFileChooser` instead.
1925
- TableHeader: Fixed custom table header renderer background stops painting
2026
after hover interactions. (issue #1089)
2127
- TextComponents: Fixed preferred width when leading/trailing components or

flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,14 @@ public boolean getSupportsWindowDecorations() {
245245
FlatNativeWindowBorder.isSupported() )
246246
return false;
247247

248+
// Disable FlatLaf window decorations on Linux if using Wayland toolkit
249+
// because moving window does not work because of bug:
250+
// https://youtrack.jetbrains.com/issue/JBR-10322
251+
// Note: This affects only Java distributions that support Wayland toolkit
252+
// (e.g. JetBrains JBR) and have enabled it with VM option: -Dawt.toolkit.name=WLToolkit
253+
if( SystemInfo.isLinux && Toolkit.getDefaultToolkit().getClass().getName().endsWith( ".WLToolkit" ) )
254+
return false;
255+
248256
return SystemInfo.isWindows_10_orLater || SystemInfo.isLinux;
249257
}
250258

flatlaf-core/src/main/java/com/formdev/flatlaf/util/SystemFileChooser.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,9 @@ private FileChooserProvider getProvider() {
785785
return new WindowsFileChooserProvider();
786786
else if( SystemInfo.isMacOS && FlatNativeMacLibrary.isLoaded() )
787787
return new MacFileChooserProvider();
788-
else if( SystemInfo.isLinux && FlatNativeLinuxLibrary.isLoaded() && FlatNativeLinuxLibrary.isGtk3Available() )
788+
else if( SystemInfo.isLinux && FlatNativeLinuxLibrary.isLoaded() &&
789+
FlatNativeLinuxLibrary.isGtk3Available() &&
790+
!Toolkit.getDefaultToolkit().getClass().getName().endsWith( ".WLToolkit" ) )
789791
return new LinuxFileChooserProvider();
790792
else // unknown platform or FlatLaf native library not loaded
791793
return new SwingFileChooserProvider();

flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DemoFrame.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,8 @@ private void initFullWindowContent() {
632632
}
633633

634634
private boolean supportsFlatLafWindowDecorations() {
635-
return FlatLaf.supportsNativeWindowDecorations() || SystemInfo.isLinux;
635+
return FlatLaf.supportsNativeWindowDecorations() ||
636+
(SystemInfo.isLinux && new FlatLightLaf().getSupportsWindowDecorations());
636637
}
637638

638639
private void initComponents() {

0 commit comments

Comments
 (0)