GNOME Bugzilla – Bug 166242
Nautilus windows opened by using the 'Places' menu are not focused.
Last modified: 2005-02-15 15:06:07 UTC
When I open a location from the 'Places' menu in the panel. Nautilus opens a window, but the window is not focused and is placed behind the other application windows.
There are two problems: 1) The relevant .desktop files do not contain "StartupNotify=true" (which is trivial to fix and one can easily do so to test for the other remaining problems) 2) Nautilus does not handle startup-notification for its own windows--this means that (a) the timestamp isn't getting forwarded along with the request to open the new window (which is why the new window appears behind the focus window), and (b) the startup-identification stuff isn't getting forwarded along with the request to open the new window (meaning that the instance of nautilus that opens the new window can't signal that the launch is over; this results in the busy cursor staying up for 15 seconds or so and an extra, spurious, task in the windowlist applet remaining for that same duration) Bug 163046 is already open for the "StartupNotify=true" in .desktop files, so let's keep this one open for the forwarding of startup-notification information. gnome-terminal could be used as an example of how to handle this (see terminal.c and terminal-window.c, as well as bug 156413 for the timestamp half). (See also bug 161322 and bug 162424 which are about related focus issues in nautilus with startup-notification, though they are different bugs)
Created attachment 37448 [details] [review] Half baked patch to add startup notification support to nautilus as a launchee This patch may be fairly ugly--I don't grasp bonobo (and I try to avoid it), and I just blatantly copy&pasted code from gnome-terminal in one place without doing much to make it fit in (and I believe part of the code I copied had in turn been copied from startup-notification...) Plus, it doesn't work when a launcher is used to show a window that had already been created (i.e. it only works when a new NautilusWindow is created). But, it's what I have so far and I thought I'd put it up. Feedback welcome.
Created attachment 37449 [details] [review] Patch that appears to be fully functional so far This version seems to work for all the cases I've thrown at it, both as far as the busy cursor and timestamps (focusing) is concerned. Watch out for the FIXME's, though. ;-)
(Don't forget to apply the patch in bug 163046 if you want to try this patch out, because otherwise this patch won't do much for you...)
Elijah, thank you for tackling this problem. I have been testing your patch, and I have found a couple startup notification issues. 1. From the panel menu, select 'Places->Network Servers'. Do not close the 'Network' window and select 'Network Servers' again. The cursor will change to the hour glass for about 30 seconds. 2. In the Places menu, 'Home Folder' and 'Computer' always open on top. But 'Desktop' and other bookmarks I create with the file-chooser can still open behind other windows on the desktop.
I sent a newer patch sent to nautilus-list that fixes the first issue you point out (http://mail.gnome.org/archives/nautilus-list/2005-February/msg00063.html). As for the second issue, I have no clue where the .desktop file is that launches the 'Desktop' folder, but it appears that the problem is that window is being launched without startup-notification. I would assume the same for the others, but I don't know my way around the file-chooser. Could you give me some baby-steps? (It'd also help if you know of documentation/bugs/sections of code that point out how bookmarks with the file-chooser have been implemented...)
Elijah, Regarding your question about opening bookmarks from the places menu, I took a look at the panel's code. It's handled in the file panel-menu-bar.c See fuction activate_uri(). The panel opens the bookmarks by calling gnome_url_show_on_screen().
It would make use of gnome_url_show... *sigh* I was hoping that gnome_url_show wasn't that important. Looks like it's causing all sorts of problems... Anyway, there's already a separate bug for that (bug 166722), so I'll close this bug if the new patch I posted to nautilus-list today also gets accepted unless anyone can find any other problems with it. Thanks for all the testing and for tracking down the gnome_url_show stuff, Dennis.
The new patch got committed as well, so I'll close this. Hopefully bug 166722 can be fixed before 2.10...