From 3d82e9a97fc168c5004986a3a332179c4e697a96 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Thu, 16 Jul 2026 12:03:46 +0200 Subject: [PATCH] Fix JfxRevealPathService opens the file instead of revealing also set priority to "Fallback" Signed-off-by: Armin Schrenk --- .../org/cryptomator/ui/fxapp/JfxRevealPathService.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/cryptomator/ui/fxapp/JfxRevealPathService.java b/src/main/java/org/cryptomator/ui/fxapp/JfxRevealPathService.java index 1271f42e8..8559e49e0 100644 --- a/src/main/java/org/cryptomator/ui/fxapp/JfxRevealPathService.java +++ b/src/main/java/org/cryptomator/ui/fxapp/JfxRevealPathService.java @@ -6,6 +6,7 @@ import org.cryptomator.integrations.common.Priority; import org.cryptomator.integrations.revealpath.RevealFailedException; import org.cryptomator.integrations.revealpath.RevealPathService; +import java.nio.file.Files; import java.nio.file.Path; /** @@ -17,14 +18,16 @@ import java.nio.file.Path; */ @DisplayName("JavaFX HostServices (GTK)") @OperatingSystem(OperatingSystem.Value.LINUX) -@Priority(10) +@Priority(Priority.FALLBACK) public class JfxRevealPathService implements RevealPathService { @Override public void reveal(Path p) throws RevealFailedException { var fxApp = FxApplication.INSTANCE.get(); if (fxApp != null) { - fxApp.getHostServices().showDocument(p.toUri().toString()); + // showDocument() launches the default app for a regular file, so reveal its parent directory instead + var target = Files.isRegularFile(p) ? p.getParent() : p; + fxApp.getHostServices().showDocument(target.toUri().toString()); } else { throw new RevealFailedException("JavaFX Application not initialized"); }