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"); }