GNOME Bugzilla – Bug 112031
focus issue wrt dialogs in metacity
Last modified: 2004-12-22 21:47:04 UTC
A window doesn't get focus if a dialog is dismissed that was above an image window. To reproduce: * use metacity WM, 'sloppy focus' (focus follows mouse, only entering a new window changes the focus (doesn't lose it leaving one) [1]) * create a new image * choose image>scale; brings up a dialog * set some values to scale it up (to make sure the window remains below the cursor and click OK Now a funny thing happens. The dialog is dismissed and the image window below it seems to get the focus and immidiately loses it. P.S.: I tried finding a bugreport on this, since I know mitch has been investigating the issue, but didn't succeed. sorry if it's a dupe. [1] my humble explanation ;)
I forgot to mention this is only an issue with GIMP. Before someone acuses me misfiling the apropriate module ;)
Still a window manager issue and should be reported against metacity. The GIMP is not doing anything special here.
Additional info: * one of my docks steals the focus (so does tigert's although a different one) * the dock windows are utility windows (GDK_WINDOW_TYPE_HINT_UTILITY) Maybe the fact that metacity keeps them above the image windows (NORMAL) results in this? I do like them being above the image windows though. cc:ing garrett and havoc, because they can work it out in person. Garrett being a GIMP person and havoc a metacity father ;)
what's a dock window in this context? The problem is probably in fact that it focuses the topmost window. Should be changed to focus last-used window.
I'm not sure what kind of information you need about the dock. Gimp UI consists of the main tollbox with a menu, image windows containing artwork and then optional docks (you can have them turned off). Docking is a new concept in GIMP. But apart from the new hint (GDK_WINDOW_TYPE_HINT_UTILITY) and the fact that you can attach them together ('dock' them) they are just windows where you can set tool options, manage image layers, select colors, gradients etc just like in 1.2. A sample GIMP session is on the following screenshot (there's only one window I referred to as 'dock' on it, since the others are attached to the main toolbox window): http://developer.gimp.org/screenshots/gimp-text.jpeg At that session, dock#1 would get focus when I'd dismiss the scale dialog. I'm willing to test the 'focus last window' patch ;)
Raising severity to major since it seems to be a major problem for GIMP users and is reported frequently.
can somebody test this with the MRU-focus patch that just went into CVS HEAD. Hopefully this won't be a problem any more. Whether we want to continue stacking utility windows above is a topic for further discussion on Bug 115092.
Just tested with metacity HEAD and I can observe no change wrt to this unfortunately :( The dialog is dismissed, the image below it blinks as it gets focus and loses it in a split second to one of the docks.
I see, apparently the full fix wasn't in that patch. Try it with the patch that's on Bug 108643.
http://bugzilla.gnome.org/showattachment.cgi?attach_id=19283 doesn't seem to apply to HEAD if that's what you ment.
it's been committed now. Try it with HEAD.
I noticed the fix of #108643 in HEAD. It seems to have fixed most of the annoying situations. This situation seems to work now: 1) create a new image 2) select image>filters>render>clouds>solid noise The image gets the focus once the dialog is dismissed pressing OK. This was broken before, now works. However: 1) create new image 2) image>scale; OK still focuses the dock, not the image window. I'm quite happy with the fix since it's most annoying when applying filters. Feel free to close it if you don't feel like investigating why scaling is different.
OK I've actually fired up the gimp now and tried it and I see what you mean. I'll play with it a bit over the next couple days and see what I can come up with. The GIMP doesn't try to set focus on any of its windows on its own, does it?
After using this for a while I found a few more places where this is still broken: * using the text tool's editor dialog (once dismissed, a dock is focused, not the image window) * using the save dialog (file>save as or save a copy)
OK it looks like the patch that went in didn't use the MRU list for focus like I thought it was going to (after all, what was the point otherwise?). I'm attaching a simple patch that seems to fix the problems that Jakub and I were able to observe.
Created attachment 19400 [details] [review] focus mru window on window free and on window minimize.
Looks good to me, thanks.
committed. Hopefully gimping will be a more pleasant experience when using metacity from now on ;-)
This has indeed fixed all the other cases. Thank you so much for the fix. It was a truly annoying bug.