After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 667881 - Application re-spawns immediately after quit
Application re-spawns immediately after quit
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2012-01-13 16:44 UTC by Xan Lopez
Modified: 2012-01-17 22:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ShellApp: Use unique name for menus (1.14 KB, patch)
2012-01-17 18:46 UTC, Colin Walters
committed Details | Review

Description Xan Lopez 2012-01-13 16:44:57 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).
Comment 1 Matthias Clasen 2012-01-13 16:54:28 UTC
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
Comment 2 Ray Strode [halfline] 2012-01-13 17:05:45 UTC
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.
Comment 3 Ray Strode [halfline] 2012-01-13 17:06:09 UTC
(woops mid-air collision)
Comment 4 Colin Walters 2012-01-17 18:46:46 UTC
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.
Comment 5 Xan Lopez 2012-01-17 19:01:50 UTC
Tested the patch in comment #4, seems to fix the bug.
Comment 6 Colin Walters 2012-01-17 19:09:34 UTC
Attachment 205472 [details] pushed as b5be62c - ShellApp: Use unique name for menus