X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;ds=sidebyside;f=shell%2Fev-application.c;h=2fc9030e7832abc309ebd2c6c0e1dd0d347b520e;hb=7aebdb8f5f4a4f44181590befdde27aac11a1e9a;hp=59ddf31758a1d55121f22a282418a268fac65c23;hpb=86dfe30d6f9934f9c035f6293743c93bc89c6a62;p=evince.git diff --git a/shell/ev-application.c b/shell/ev-application.c index 59ddf317..2fc9030e 100644 --- a/shell/ev-application.c +++ b/shell/ev-application.c @@ -283,18 +283,26 @@ ev_spawn (const char *uri, break; } - g_string_append_printf (cmd, " %s", uri); - cmdline = g_string_free (cmd, FALSE); app = g_app_info_create_from_commandline (cmdline, NULL, 0, &error); if (app != NULL) { + GList uri_list; + ctx = gdk_display_get_app_launch_context (gdk_screen_get_display (screen)); gdk_app_launch_context_set_screen (ctx, screen); gdk_app_launch_context_set_timestamp (ctx, timestamp); - g_app_info_launch (app, NULL, - G_APP_LAUNCH_CONTEXT (ctx), &error); + /* Some URIs can be changed when passed through a GFile + * (for instance unsupported uris with strange formats like mailto:), + * so if you have a textual uri you want to pass in as argument, + * consider using g_app_info_launch_uris() instead. + * See https://bugzilla.gnome.org/show_bug.cgi?id=644604 + */ + uri_list.data = (gchar *)uri; + uri_list.prev = uri_list.next = NULL; + g_app_info_launch_uris (app, &uri_list, + G_APP_LAUNCH_CONTEXT (ctx), &error); g_object_unref (app); g_object_unref (ctx); @@ -392,6 +400,10 @@ on_reload_cb (GObject *source_object, } g_variant_unref (value); + /* We did not open a window, so manually clear the startup + * notification. */ + gdk_notify_startup_complete (); + ev_application_shutdown (EV_APP); }