! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Always asks for program to open with when called through xdg-open
Status:
RESOLVED: DUPLICATE

Comments

Description Martin Pitt 2010-08-10 10:34:26 CEST
Browsers, mail clients, etc. often use xdg-open or gnome-open to display file attachments or downloads. When doing that in XFCE with Thunar 1.1.x (tested .0 and .1), this calls exo-open -> exo-helper-1 -> Thunar $path.

When thunar is called that way, i. e. with a single path, it always brings up the file association dialog, even if you click "remember". This does not happen if you click on a file in the Thunar browser.

I tested that with a simple .jpg image, with having eog installed.
Comment 1 Martin Pitt 2010-08-10 12:15:08 CEST
Keeping notes here:

thunar_file_launch() calls thunar_file_get_default_handler() on the file (.jpg in my case), but this returns

(lt-Thunar:3995): Thunar-DEBUG: thunar_file_launch(00005.jpg): got app_info = 0x23e8890
(lt-Thunar:3995): Thunar-DEBUG: thunar_file_launch: app_info name=exo-helper-1 exe=/usr/lib/libexo-1-0/exo-helper-1 --launch FileManager %u

I. e. this hits the "recursive" case which is guarded in the subsequent code (marked with "HACK") which calls thunar_show_chooser_dialog().
Comment 2 Martin Pitt 2010-08-10 12:49:22 CEST
More notes:

So, in my GNOME system, g_file_query_default_handler("myphoto.jpg") delivers the correct result:

name=Image Viewer exe=eog %U

but in my XFCE system (which is severely stripped down admittedly, but also has eog installed) I get

name=exo-helper-1 exe=/usr/lib/libexo-1-0/exo-helper-1 --launch FileManager %u

If I disable /usr/lib/gio/modules/libexo-module-1.so, then I get the correct answer again, so it seems that exo somehow clobbers the mime handlers which are defined in /usr/share/applications?
Comment 3 Martin Pitt 2010-08-10 13:30:25 CEST
For the record, I reported that on exo 0.5.2 (doesn't exist in the Version dropdown in bugzilla), and also confirmed on 0.5.3.

Subscribing Nick, since he wrote exo-gio-module/exo-module.c according to the comment in the file.

Nick, why does this module overwrite the handler for all file:// URLs? We certainly want exo-helper for http:// etc. URLs, but for files we should rather rely on /usr/share/applications/*.desktop to register the MIME types. If I drop the "file" match from that module, then "exo-open foo.jpg" now does the right thing and opens eog right away (gio -> eog), instead of giving me the chooser dialog through the gio -> exo-helper -> Thunar -> dialog -> eog maze. But maybe I'm missing something here?

Thank you,

Martin
Comment 4 Jannis Pohlmann editbugs 2010-10-19 15:54:50 CEST

*** This bug has been marked as a duplicate of bug 6167 ***

Bug #6627

Reported by:
Martin Pitt
Reported on: 2010-08-10
Last modified on: 2010-10-19

People

Assignee:
Jannis Pohlmann
CC List:
2 users

Version

Attachments

Additional information