From ea7448deddc38daed18c3f87dc5a5db9f090d146 Mon Sep 17 00:00:00 2001 From: Aleksandr Zvegintsev Date: Fri, 28 Jun 2024 07:36:53 +0200 Subject: [PATCH] Use the secondary path for token storage only if it is writable and there is no writable file on the primary path. --- .../java/com/sun/glass/ui/gtk/screencast/TokenStorage.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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)) {