GNOME Bugzilla – Bug 273912
Compose window not presented when launched from another application (focus stealing prevention)
Last modified: 2008-11-19 14:43:42 UTC
Description of Problem: In gnome 2.10 launching evolution as mailto: protocol handler when evo is already running doesn't bring up the composer window properly. Steps to reproduce the problem: 1. Make sure evolution is the preferred mail reader in gnome 2. Run Epiphany/Galeon and select File/Send Link To... Actual Results: Seemingly nothing happens. If you carefully look at the window list applet (assuming you have one) you'll see evolution title changed to bold. Expected Results: Composer window is presented on top. How often does this happen? Always with gnome 2.10 / metacity 2.10.0 Additional Information: This is caused by the focus stealing prevention work, applications that launch windows from an already existing instance need to handle the situation more carefully.
this is a window manager issue on my window manager a new window pops up on the front of the current desktop
Last time I checked metacity was the default window manager for GNOME. It would be rather weird for a GNOME desktop application to not play along with the desktop.
I believe epiphany/galeon are using gnome_vfs_url_show, which doesn't take a timestamp ("launch time") parameter, and thus launching evolution without startup notification. Since I believe Evolution is one of those applications that makes any instance beyond the first just tell the first instance what to do and then quit, this means that evolution (via gtk+) wil open a window with an old timestamp (namely, the timestamp of the last time evolution was interacted with, rather than the last epiphany/galeon interaction). A few things need to be done: 1) Assuming I'm correct about Evolution being a single-instance-only app, Evolution needs to forwarding the launch timestamp along with the other information it sends from the new instance to the original instance. (See http://mail.gnome.org/archives/desktop-devel-list/2004-December/msg00306.html for the details about all stuff apps need to do). Gnome-terminal, nautilus, epiphany, and galeon recently went through this (at varying levels, since some had complete support for the prior startup-notification spec while others didn't), so there are example patches out there. 2) Evolution should override the gtk+ launch time guess when it is launched without startup-notification, because gtk+'s guess is bad for forward-open-window-request-to-previous-instance applications. Again, gnome-terminal, nautilus, epiphany, and galeon have recently done this so there are example patches out there. 3) gnome-vfs needs a gnome_vfs_open_url variant that takes a launch time timestamp, and applications need to use it. But that's a gnome-vfs issue; I'll mention this specific case in bug 166197.
like i said, my window manager just works. sounds like gnome is broken.
Ok, a quick explanation: Having windows appear on top by default is good. Having windows always appear on top is buggy. The same holds true if you replace "on top" by "with focus" (for the majority use case anyway; I am aware that some traditional Unix users like things like never-focus-new-windows combined with either always-place-windows-on-top or never-place-windows-on-top among many other things). Basically, if the user launches an application (which I'll refer to as A) and interacts with another application (which I'll refer to as B) before A appears then A should not appear with focus nor should it appear on top (again, for the majority use case). The trick is that the window manager needs to know when A was launched and when the focused window, B, was last used and compare those two timestamps. gtk+ handles most of the timestamp stuff for applications (including when a new window is 'launched' (opened) from the application itself). It can't however know the time the user caused the application to be launched as that interaction occurred in a different application. Startup-notification usually provides gtk+ with the missing information but some apps (e.g. gnome-terminal, gedit, nautilus, mozilla, epiphany, evolution, etc.) do stuff behind gtk+'s back by forwarding an open-window request instead of opening a window themselves. These apps need to also forward the timestamp information so that gtk+ and the window manager can do its job (also, most of the apps in that list now do so). Steps 1 & 2 in comment 3 specify what need to be done here. I'm willing to help out with it when I get some free time, though it'd be nice if others could point out the code for both the sending and receiving ends of the open-window forwarding request stuff to save me a little time...
*** Bug 331314 has been marked as a duplicate of this bug. ***
*** Bug 357933 has been marked as a duplicate of this bug. ***
Seems to work fine with Evolution 2.24. Closing as FIXED.