mirror of
https://github.com/mitb-archive/filebot
synced 2024-11-05 17:05:04 -05:00
JDK BUG: Desktop.browse() doesn't work in snap environment but xdg-open works just fine
This commit is contained in:
parent
ab32d2feeb
commit
f2051e835b
@ -79,7 +79,13 @@ public final class SwingUI {
|
||||
|
||||
public static void openURI(String uri) {
|
||||
try {
|
||||
Desktop.getDesktop().browse(URI.create(uri));
|
||||
if (Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) {
|
||||
Desktop.getDesktop().browse(URI.create(uri));
|
||||
} else {
|
||||
// JDK BUG: Desktop.browse() doesn't work in snap environment but xdg-open works just fine
|
||||
ProcessBuilder p = new ProcessBuilder("xdg-open", uri);
|
||||
p.inheritIO().start();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
debug.log(Level.SEVERE, "Failed to open URI: " + uri, e);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user