GNOME Bugzilla – Bug 667881
Application re-spawns immediately after quit
Last modified: 2012-01-17 22:05:35 UTC
After porting Epiphany to GtkApplicationWindow+global menu, and using the Shell from git master, the following happens: - Launch epiphany. - Close it (say, Ctrl+Q) - A new epiphany is immediately spawned (from /usr/bin), but it's hidden - About half a minute passes - The window is presented by the Shell. After some investigation on IRC it seems that the issue is that the Shell calls org.gtk.Menus.End() on ephy when it's already gone, so per dbus rules a new instance is spawned. Since this one (from /usr/bin) is not ported to the app menu it just sits there not knowing what to do for a while, and then it is presented by the Shell (I suppose there's some timeout that controls this somewhere).
there's two things that should be changed here: 1) the shell should use the unique name, not the well-known name 2) the proxies used here should use the do-not-autostart flag
seems like there are 3 possible fixes: 1) pass the result of g_dbus_proxy_get_name_owner () to g_dbus_menu_model_get () in on_dbus_proxy_gotten 2) make g_dbus_menu_group_get find the name owner on its own 3) change the g_dbus_connection_call calls in gdbusmenumodel.c in gio to have G_DBUS_CALL_FLAGS_NO_AUTO_START could probably do all of the above to make things really robust, but I think any of the above would fix it.
(woops mid-air collision)
Created attachment 205472 [details] [review] ShellApp: Use unique name for menus Otherwise since the auto-activate flag is set for dbus messages, we may re-vivify applications that have DBus service files.
Tested the patch in comment #4, seems to fix the bug.
Attachment 205472 [details] pushed as b5be62c - ShellApp: Use unique name for menus