GNOME Bugzilla – Bug 454503
Gnome doesn't focus after app operation an already open app
Last modified: 2007-07-07 19:43:45 UTC
If I open a link in mail program. im or something like that and Firefox is not running it is started and gets a focus but if Firefox is already running the link gets loaded in Firefox but the mail program still has the focus so you think nothing happens. The most annoying problem is that Firefox opens for some operation like downloads a new window. If you change back to main Firefox and click another download which appears in the opened popup you have to change manually to it. But this is not only Firefox specific since it doesn't happen in KDE or Windows afaik. Same happens with Totem and I guess many more applications which allow only one instance. If someones want to check it. 1. Open Nautilus and make it full screen. 2. Open a video in Totem. 3. Change back to Nautilus. 4. Start another video with Totem. => Totem plays the new video but doesn't get focused. Same happens with Evolution. If it is already running and you start it again another instance is started but it gets not focused. This doesn't happen if no Evolution is running. It is very likely that people click several times on a file until they realize. Other information:
totem, evolution, and mozilla do not support startup-notification correctly; this is a bug in those particular applications (these apps wouldn't need to do anything to support it other than use gtk if they weren't single instance apps, but by being single instance apps they do things behind gtk+'s back). I'm not aware of a bug report for totem for this. evolution's bug is bug 273912. Mozilla's is https://bugzilla.mozilla.org/show_bug.cgi?id=223492. capplets and gnome-system-monitor are already being tracked at bug 351092, and additional bug reports against single-instance apps to fix this issue should also be tracked there. *** This bug has been marked as a duplicate of 351092 ***
But why does this only happen under Gnome and not KDE or Windows?
KDE has long had a KUniqueApp library, which KDE apps use and takes care of startup-notification stuff for the apps. Gnome didn't have such a library until recently (GtkUnique), and it's still in not-officially-accepted status (many people may be waiting for it to be merged into gtk+ to use it, which has not happened yet). Because of that, each GNOME application rolled their own single-instance stuff and each either ignored startup-notification handling completely or horribly botched it in new and interesting ways different than the previous hand-rolled implementation. Windows has a completely different API of their own, and since apps are written using the Windows APIs (and even QT and gtk+ apps need to be implemented in terms of Windows APIs) it is likely that things are handled for them. The startup-notification stuff really is specific to X.