GNOME Bugzilla – Bug 755948
g_app_info_launch_uris does not seem to be launching apps when uri is an URL
Last modified: 2015-10-02 08:03:00 UTC
Evince uses g_app_info_launch_uris in order to spawn new instances for multiple arguments. g_app_info_launch_uris does not seem to be passing the right URIs to the application. How reproducible: #include <gio/gdesktopappinfo.h> int main(int argc, char *argv[]) { GAppInfo *app; GList uri_list; GFile *file; gboolean res; GError *error = NULL; app = g_app_info_create_from_commandline ("/usr/bin/evince", NULL, 0, &error); uri_list.data = (gchar*) argv[1]; uri_list.prev = uri_list.next = NULL; res = g_app_info_launch_uris (app, &uri_list, NULL, &error); g_object_unref (app); return res; } g_app_info_launch_uris is returning TRUE for arguments such as http://www.farnell.com/datasheets/664229.pdf, although it does not really launch anything. It works fine for local uris such as file:///home/fborges/664229.pdf
That seems pretty a backwards way to go about launching more instances of yourself, but if you want to go that route and make it work for uris, you need to pass G_APP_INFO_CREATE_SUPPORTS_URIS
Thank you for the heads up.