From 720b0d0273ea9033f02e4ad6857e7f15fcc040c4 Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 13 Feb 2022 10:45:44 -0500 Subject: [PATCH] linkbrowser: prefer xdg-open over Desktop.open and browse Desktop.open/Desktop.browse doesn't work on Linux with gtk3 See JDK-8275494 --- .../net/runelite/client/util/LinkBrowser.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/util/LinkBrowser.java b/runelite-client/src/main/java/net/runelite/client/util/LinkBrowser.java index e8965029c1..07ac4a2d87 100644 --- a/runelite-client/src/main/java/net/runelite/client/util/LinkBrowser.java +++ b/runelite-client/src/main/java/net/runelite/client/util/LinkBrowser.java @@ -60,17 +60,17 @@ public class LinkBrowser return; } - if (attemptDesktopBrowse(url)) - { - log.debug("Opened url through Desktop#browse to {}", url); - return; - } - if (shouldAttemptXdg && attemptXdgOpen(url)) { log.debug("Opened url through xdg-open to {}", url); return; } + + if (attemptDesktopBrowse(url)) + { + log.debug("Opened url through Desktop#browse to {}", url); + return; + } log.warn("LinkBrowser.browse() could not open {}", url); showMessageBox("Unable to open link. Press 'OK' and the link will be copied to your clipboard.", url); @@ -91,18 +91,18 @@ public class LinkBrowser return; } + if (shouldAttemptXdg && attemptXdgOpen(directory)) + { + log.debug("Opened directory through xdg-open to {}", directory); + return; + } + if (attemptDesktopOpen(directory)) { log.debug("Opened directory through Desktop#open to {}", directory); return; } - if (shouldAttemptXdg && attemptXdgOpen(directory)) - { - log.debug("Opened directory through xdg-open to {}", directory); - return; - } - log.warn("LinkBrowser.open() could not open {}", directory); showMessageBox("Unable to open folder. Press 'OK' and the folder directory will be copied to your clipboard.", directory); }).start();