GNOME Bugzilla – Bug 620161
gtk_show_uri opens http urls in a browser other than the GNOME default.
Last modified: 2010-09-20 16:30:58 UTC
This is Debian bug #583302 (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=583302) Evolution is ignoring my preference for default web browser when I click on links. default-applications-properties is set to iceweasel, x-www-browser is set to iceweasel $BROWSER is set to iceweasel and yet Evolution chooses chromium-browser instead. This is in consonance with the contents of /usr/share/applications/mimeinfo.cache and Evolution runs runs through the applications there in order text/html=bluefish.desktop;chromium-browser.desktop;kde4-kfmclient_html.desktop;abiword.desktop;iceweasel.desktop;kompozer.desktop;arora.desktop;elinks.desktop; [bloom@cat-in-the-hat evolution]$ strace -f evolution 2>&1 | grep /usr/share/applications/ [pid 7465] stat("/usr/share/applications/mimeinfo.cache", <unfinished ...> [pid 7465] open("/usr/share/applications/mimeinfo.cache", O_RDONLY) = 44 [pid 7465] stat("/usr/share/applications/defaults.list", <unfinished ...> [pid 7465] stat("/usr/share/applications/mimeapps.list", <unfinished ...> [pid 7465] open("/usr/share/applications/bluefish.desktop", O_RDONLY <unfinished ...> [pid 7465] open("/usr/share/applications/chromium-browser.desktop", O_RDONLY <unfinished ...> if I uninstall chromium, it opens the link in konqueror, by calling kfmclient. Evolution should use the Gnome default browser to open hyperlinks, rather than opening them by MIME type.
We use gtk_show_uri() and GVFS handles the rest. Not an Evolution issue.
Well, either Evolution is wrong to call gtk_show_uri(), or gtk_show_uri() is doing the wrong thing. If it's the former, please fix it. If it's the later, please reassign to gtk+.
I'm reassigning this on the theory that gtk_show_uri() is doing the wrong thing.
What does gconftool-2 --get /desktop/gnome/url-handlers/http/command say ?
sensible-browser %s
Just to clarify, sensible-browser is a tool in Debian that runs through several different standard places to select a web browser, and runs the first browser that it finds in these places. First it looks at $BROWSER (which, as I mentioned, is set to iceweasel) Then it looks at three alternatives in order: /usr/bin/gnome-www-browser which links to /usr/lib/iceweasel/iceweasel if $DISPLAY and $GNOME_DESKTOP_SESSION_ID are set /usr/bin/x-www-browser which links to /usr/lib/iceweasel/iceweasel if $DISPLAY is set if these environment variables are not set (or these links are not executable), it runs www-browser (in a terminal window if $DISPLAY is set) /usr/bin/www-browser links to /usr/bin/links2 It is also clear from the strace of evolution that sensible-browser is not getting run, rather gtk_show_uri is looking through the mime handlers and picking from there.
The call path is gtk_show_uri g_app_info_launch_default_for_uri g_file_query_default_handler g_app_info_get_default_for_uri_scheme Which will use the gconf implementation to look up /desktop/gnome/url-handlers/http/command
Testing this in gdb (for the URL https://bugzilla.gnome.org/show_bug.cgi?id=620161) I see that uri_scheme = "http" and g_app_info_get_default_for_uri_scheme is returning null.
What does gconftool-2 --get /desktop/gnome/url-handlers/http/enabled say ? the gconf implementation looks at that as well.
It says "true".
No further ideas here. A simple test confirms that this works as expected here. You could debug into the gconf backend and see whats going on in gapplookupgconf.c:get_default_for_uri_scheme
In any case, this is not a GTK+ bug
What process am I supposed to debug to trace get_default_for_uri_scheme? It looks like the symbol is in /usr/lib/gio/modules/libgiogconf.so, but lsof doesn't tell me that any process has it loaded.
In that case, thats likely your problem. do you have a /usr/lib/gio/modules/giomodule.cache ? if so, what does it contain ?
It appears the real problem is that I really want to get appropriate default browser behavior without running gnome-session (or at least running a highly customized list of stuff from my .xsession and not running all of the gnome graphical stuff.) If I run gnome-session, and then start evolution from the panel, things work. If I run gnome-session, and then start evolution from a pre-existing termianl, things don't work. Is it really true that gnome-session provides this information to the programs that need it? Is there any way I can make the default browser behavior work without having to throw away my highly customized desktop setup?
oh, sorry, I don't really have the bandwidth to debug handrolled session setups right now
Sorry to wast your time. Any tips where to look for more information?
GNOME_DESKTOP_SESSION_ID will obviously not be set in the environment if you don't start the mailer from a child of gnome-session. That's how environment variables work.
For those who want to use the GNOME default web browser to visit URIs in GTK+ applications, but do not want to run a full GNOME session yourself, the workaround is to set the environment variable GIO_USE_URI_ASSOCIATION=gconf. (I discovered this by reading http://library.gnome.org/devel/gio/stable/ch03.html and experimenting a bit). I'm sure the procedure for using the XFCE4 default web browser is similar, but I don't know the name of the GDesktopAppInfoLookup implementation to use.