FlatDesktop: avoid unnecessary logging if desktop is not supported (e.g. on NixOS with Plasma/KDE desktop)

This commit is contained in:
Karl Tauber
2026-01-14 13:21:52 +01:00
parent aaca7cace1
commit 465254c0da
2 changed files with 4 additions and 1 deletions

View File

@@ -14,6 +14,8 @@ FlatLaf Change Log
- UI defaults inspector: Fixed NPE if color of `FlatLineBorder` is null. Also - UI defaults inspector: Fixed NPE if color of `FlatLineBorder` is null. Also
use `FlatLineBorder` line color as cell background color in "Value" column. use `FlatLineBorder` line color as cell background color in "Value" column.
(PR #1080) (PR #1080)
- `FlatDesktop`: Avoid unnecessary logging if desktop is not supported (e.g.
on NixOS with Plasma/KDE desktop).
## 3.7 ## 3.7

View File

@@ -43,7 +43,8 @@ public class FlatDesktop
public static boolean isSupported( Action action ) { public static boolean isSupported( Action action ) {
if( SystemInfo.isJava_9_orLater ) { if( SystemInfo.isJava_9_orLater ) {
try { try {
return Desktop.getDesktop().isSupported( Enum.valueOf( Desktop.Action.class, action.name() ) ); return Desktop.isDesktopSupported() &&
Desktop.getDesktop().isSupported( Enum.valueOf( Desktop.Action.class, action.name() ) );
} catch( Exception ex ) { } catch( Exception ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex ); LoggingFacade.INSTANCE.logSevere( null, ex );
return false; return false;