Fix JfxRevealPathService opens the file instead of revealing

also set priority to "Fallback"

Signed-off-by: Armin Schrenk <armin.schrenk@skymatic.de>
This commit is contained in:
Armin Schrenk
2026-07-16 12:03:46 +02:00
parent bdab18b7c3
commit 3d82e9a97f
@@ -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");
}