linkbrowser: prefer xdg-open over Desktop.open and browse

Desktop.open/Desktop.browse doesn't work on Linux with gtk3

See JDK-8275494
This commit is contained in:
Adam
2022-02-13 10:45:44 -05:00
parent 9019d0833b
commit 720b0d0273

View File

@@ -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();