#5629 closed enhancement (fixed)
[Patch] Use xdg-open first for opening links
Reported by: | quazgar | Owned by: | team |
---|---|---|---|
Priority: | minor | Milestone: | 14.01 |
Component: | Core | Version: | latest |
Keywords: | Cc: |
Description (last modified by )
Currently gnome-open is used as the first helper application to open links, regardless of which window manager is used.
The attached patch used xdg-open (from freedesktop.org) as the first try. If that fails, the other alternatives are used in the order used before. This should work for all modern window managers equally well.
I suggest applying this patch to the current source, I tried & tested it with latest svn (3652), it compiles and runs fine.
Attachments (1)
Change History (10)
by , 14 years ago
Attachment: | 0001.xdg-open.patch added |
---|
comment:1 by , 14 years ago
Summary: | Patch: Use xdg-open first for opening links → [Patch] Use xdg-open first for opening links |
---|
follow-up: 3 comment:2 by , 14 years ago
See #5108.
The code you patched is not executed under normal circumstances.
From OpenBrowser.java:
if (Desktop.isDesktopSupported()) { try { Desktop.getDesktop().browse(uri); } catch (Exception e) { e.printStackTrace(); return e.getMessage(); } } else { System.err.println("Warning: Desktop class is not supported. Platform dependent fall back for open url in browser."); if (Main.platform == null) throw new IllegalStateException(tr("Failed to open URL. There is currently no platform set. Please set a platform first.")); try { Main.platform.openUrl(uri.toString()); } catch (IOException e) { return e.getMessage(); } }
Desktop.isDesktopSupported()
should return true on all modern platforms.
Maybe like this:
(1) xdg-open
(2) Desktop.getDesktop().browse()
(3) gnome-open, kfmclient openURL, firefox
comment:3 by , 14 years ago
Replying to bastiK:
See #5108.
The code you patched is not executed under normal circumstances.
From OpenBrowser.java:
...
True, I didn't check if gnope-open was still used here with the latest svn version :) I just experienced the mentioned problem with the version I had installed (r3514), but the mentioned change seems to have been done in r3524.
Maybe like this:
(1) xdg-open
(2) Desktop.getDesktop().browse()
(3) gnome-open, kfmclient openURL, firefox
If someone wants to implement this order, I'd really welcome it, but it's no high priority for me any more :)
I'm just not sure though if all supported Desktops porperly configure, so maybe it should be simply
(1) Desktop.getDesktop().browse()
(2) xdg-open, gnome-open, kfmclient openURL, firefox
I would rather leave this decision to desktop environment experts though.
comment:4 by , 14 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
comment:6 by , 12 years ago
Please merge this patch. I understand that this code does not execute for a large percentage of your users, but it's 12 bytes, and helps those of us with unusual window managers (like me, and the person who sent in the patch.)
comment:7 by , 12 years ago
Description: | modified (diff) |
---|
+1. xdg-open
seems to be standard for opening files by extension under Linux.
comment:9 by , 11 years ago
Component: | unspecified → Core |
---|---|
Milestone: | → 14.01 |
Patch to implement the proposed change