GNOME Bugzilla – Bug 336780
Windows do not open on top
Last modified: 2006-05-04 00:13:17 UTC
Please describe the problem: Ever since I started using the current Dapper repositories, new windows often, but not always, open behind the currently active window, whereas they used to open in front. This does not happen with all programs, but I've noticed it is consistent with Synaptic, the Logout dialogue, and several. Steps to reproduce: 1. Open an application 2. Open another application (Synaptic, logout dialogue, or another program--I'll try to compile a more thorough list), either from a menu or with a keyboard shortcut. Actual results: The new application's window opens behind the current application. Expected results: The application should appear on top Does this happen every time? With certain applications, yes. Other information: I am still trying to determine all the applications this happens with, but it seems to be several. I don't know if this is a Metacity bug or stems from the programs themselves.
Are you launching these programs from a terminal?
The result is the same if I use a keyboard shortcut, panel icon, or command line.
All right, that helps me narrow it down. So here's my guesses: It happens for Evolution for any windows opened beyond the first (bug 273912), it happens for firefox and mozilla for any windows opened beyond the first (https://bugzilla.mozilla.org/show_bug.cgi?id=223492), but it doesn't happen for yelp (fixed by Don Scorgie in 2.13 -- bug 310237), epiphany or galeon (fixed by Crispin during 2.9), gnome-terminal, nautilus, the alt+F2 dialog, evince, or any gnome application that doesn't do the only-run-a-single-instance thing. (See also bug 149028) Could you verify? I don't have synaptic to try to reproduce, though it doesn't surprise me. However, I can't duplicate the logout dialog thing. How are you logging out (do you have a keyboard shortcut? Are you clicking on the Desktop menu of the panel and then on the log out option? Or is it something else)?
I've tried all the programs you list, and here's what I've found: Firefox, Mozilla, and Epiphany sometimes open up behind the active window (whether you're opening the first instance or subsequent instances), but not always. I have been unable to determine under what conditions this happens, but it seems more likely to happen for the second instance if the active window is some other program. But this does not consistently happen. I can try the exact same thing several times in a row, and 1/2 to 2/3 of the time the new window will show up behind. If the program in question is active, the new window generally appears on top. As far as I can tell, Galeon, gnome-terminal, evolution, f2-dialogue, and yelp open in front on all instances. The second instance of evince sometimes opens behind the active window if the active window is something other than evince. I tried the logout dialogue again, and about 2/3 of the time it appeared behind the active window, the rest of the time in front. The only programs that consistently show up behind are gksudo programs like Synaptic, the discs-conf, gparted, etc.
Yeah, this is definitely the focus-stealing-prevention stuff. The idea is basically: New windows should general get focus when they appear. However, if the user started interacting with another apps between when the window was launched and when it appears, then the window shouldn't get focus when it appears. Unfortunately, apps that are single-instance-only tend to lie about the time they were launched (claiming dates that were way too old in general); there's a bug in a number of them that we need to fix. It's going to depend a lot upon which window was active when the window finally appears, how recently you had clicked or typed in that window, and how recently you had clicked or typed in another window of the application being launched again. (It'll also depend on whether a gnome-terminal has the focus; a recent change separate from focus-stealing-prevention but which will make it much harder for you to figure out patterns -- I'd suggest just shutting down or minimizing all terminals if you want to practice duplicating) We already have a separate bug for "there's still apps that need to be fixed" so it doesn't make sense to have a separate one. However, I can't duplicate the thing with the logout dialog. Let me ask again: How are you logging out?
I'm logging out using the new dialogue that comes with Dapper, which I believe is not part of Gnome. It's just a kind of splash screen with options (Log Out, Switch User, Restart, etc.). So maybe it's an Ubuntu bug, but it consistently appears behind the active window.
I mentioned the apps you're having problems with in bug 149028 (the ones that weren't already known anyway). Since I'm fairly certain the bug lies with those programs and none of the new ones you mentioned are tracked in Gnome bugzilla, I'm going to resolve as notgnome. However, I added the comment in bug 149028 specifically so that I'll remember to try to contact the app authors and help them fix the bugs. Thanks. :)