GNOME Bugzilla – Bug 625971
Add option so FindDocument method in Evince Daemon can spawn an evince process.
Last modified: 2010-08-29 17:22:24 UTC
When Calling "FindDocument" DBUS method on the Evince Daemon, it would be nice to pass a new option "spawn" that instructs the daemon to spawn a new instance of evince for the given URI if no current instance can be found. A mainly working patch comes in second comment. the only thing not working is that when I close the evince instance (that was spawn by the ev-daemon with g_spawn_async) the Evince window is not destroyed. Should I use gdk_spawn_on_screen instead? or am I missing some options to g_spawn_async?
Created attachment 167066 [details] [review] Proposed patch.
Review of attachment 167066 [details] [review]: You are creating the document and adding it to ev_daemon_docs before they are registered. ev_daemon_docs is the list of registered documents. I think documents should only be created in RegisterDocument. We might use a global hash_table to store the list of pending incovations for every uri ::: shell/ev-daemon.c @@ +349,3 @@ + char *argv[3]; + + argv[0] = g_build_filename (BINDIR, "evince", NULL); You are leaking this @@ +360,3 @@ + + g_spawn_async (NULL, argv, NULL, + 0, NULL, NULL, NULL, NULL); Please, check exit status and handle possible errors here.
Created attachment 167133 [details] [review] Updated patch. Patch reworked to use a global hash_table.
Pushed with some minor changes to master and gnome-2-32. Thanks!