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

@@ -43,7 +43,8 @@ public class FlatDesktop
public static boolean isSupported( Action action ) {
if( SystemInfo.isJava_9_orLater ) {
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 ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
return false;