diff --git a/modules/javafx.graphics/src/main/java/com/sun/glass/ui/gtk/screencast/TokenStorage.java b/modules/javafx.graphics/src/main/java/com/sun/glass/ui/gtk/screencast/TokenStorage.java index d678ff8cc0c..46018d9f3f2 100644 --- a/modules/javafx.graphics/src/main/java/com/sun/glass/ui/gtk/screencast/TokenStorage.java +++ b/modules/javafx.graphics/src/main/java/com/sun/glass/ui/gtk/screencast/TokenStorage.java @@ -114,12 +114,12 @@ private static Path setupPath() { return null; } + Path primaryPath = Path.of(userHome, REL_NAME); Path secondaryPath = Path.of(userHome, REL_NAME_SECONDARY); - // use secondary path only if it already exists and writable - Path path = Files.isWritable(secondaryPath) + Path path = Files.isWritable(secondaryPath) && !Files.isWritable(primaryPath) ? secondaryPath - : Path.of(userHome, REL_NAME); + : primaryPath; Path workdir = path.getParent(); if (!Files.isWritable(path)) {