If possible, Ubuntu w/ unity now uses gvfs-open instead of xdg-open
This commit is contained in:
parent
a463787266
commit
87065cafd4
@ -32,6 +32,9 @@ import dorkbox.util.process.ShellExecutor;
|
|||||||
@SuppressWarnings({"WeakerAccess", "Convert2Lambda", "Duplicates"})
|
@SuppressWarnings({"WeakerAccess", "Convert2Lambda", "Duplicates"})
|
||||||
public
|
public
|
||||||
class Desktop {
|
class Desktop {
|
||||||
|
// used only for ubuntu + unity
|
||||||
|
private static final boolean UBUNTU_GVFS_VALID = OSUtil.Linux.isUbuntu() && OSUtil.DesktopEnv.isUnity() && new File("/usr/bin/gvfs-open").canExecute();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Launches the default browser to display the specified HTTP address.
|
* Launches the default browser to display the specified HTTP address.
|
||||||
* <p>
|
* <p>
|
||||||
@ -197,7 +200,13 @@ class Desktop {
|
|||||||
*/
|
*/
|
||||||
private static
|
private static
|
||||||
void launch(final String path) {
|
void launch(final String path) {
|
||||||
if ((OSUtil.Linux.isUbuntu() || OSUtil.DesktopEnv.isGnome()) && GnomeVFS.isInited) {
|
// ubuntu, once again, takes the cake for stupidity.
|
||||||
|
if (UBUNTU_GVFS_VALID) {
|
||||||
|
// ubuntu has access to gvfs-open. Ubuntu is also VERY buggy with xdg-open!!
|
||||||
|
ShellExecutor.run("gvfs-open", path);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (OSUtil.DesktopEnv.isGnome() && GnomeVFS.isInited) {
|
||||||
GtkEventDispatch.dispatch(new Runnable() {
|
GtkEventDispatch.dispatch(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public
|
public
|
||||||
|
Loading…
Reference in New Issue
Block a user