GNOME Bugzilla – Bug 138298
Script-fu settings dialog does not take focus, appears underneath other windows
Last modified: 2018-04-15 00:24:05 UTC
Using Windows XP and Gimp 2.0.0 -- Start the Gimp, create or open an image, and then choose a script-fu item from the menu that opens a settings dialog. The first time this is done after starting the Gimp, the settings dialog appears underneath other opens windows and needs to be selected in the task bar.
We do not position this window in any way nor is it any different than other dialog windows. So this seems to be a problem of your window manager and I have no idea what we could do about it.
Confirmed by Dov on #gimp. Seems to be Win32 specific.
Yes, I have of course noticed this myself and it is very irritating. Unfortunately I'm afraid that the code in gtk+/gdk/win32 which handles window state changes (show/hide/minimize/unminimize/etc) is quite fragile, and changing anything to fix one thing requires very thorough testing that something else didn't break... Will take some time. Reassigning to GTK+. Probably this is a duplicate of another report.
Mass changing gtk+ bugs with target milestone of 2.4.2 to target 2.4.4, as Matthias said he was trying to do himself on IRC and was asking for help with. If you see this message, it means I was successful at fixing the borken-ness in bugzilla :) Sorry for the spam; just query on this message and delete all emails you get with this message, since there will probably be a lot.
Confirming on Vista32, Gimp 2.6.7
Confirming this for: 2.6.11, 2.7.5 and 2.8RC1 on Windows 7 (32 bit) Not confirming this for: 2.6.12 on Linux and OS X You don't need to open or create an image first, the problem 'works out of the box' ;-)
*** Bug 673871 has been marked as a duplicate of this bug. ***
*** Bug 674028 has been marked as a duplicate of this bug. ***
Bug #674028 states that this now only happens for the first time a script is used in GIMP.
*** Bug 707313 has been marked as a duplicate of this bug. ***
Confirming that this is still in GIMP 2.8.6. The same happens for me on OSX 10.6.8. with Parthas GIMP 2.8.6 build, see also bug #677776. Because I don't know whether it is platform-specific or not, I keep both bugs open. Please someone mark the other bug as duplicate of this if it's not platform-specific.
See: https://msdn.microsoft.com/en-us/library/windows/desktop/ms632668%28v=vs.85%29.aspx here the problem is that the script-fu process does not satisfy the conditions stated in that link under 'Remarks' to set the foreground window. The solution is Gimp calling AllowSetForegroundWindow passing the script-fu processId and only then script-fu show the dialog. I tried that adding a procedure to the pdb that script-fu calls passing it the result of GetCurrentProcessId https://msdn.microsoft.com/en-us/library/windows/desktop/ms683180%28v=vs.85%29.aspx and the dialog is shown on top of the canvas. Saving the result of GetForegroundWindow before showing the dialog and passing it to SetForegroundWindow after gtk_main returns when GetForegroundWindow returns NULL also gives back the focus to the main window
We're moving to gitlab! As part of this move, we are moving bugs to NEEDINFO if they haven't seen activity in more than a year. If this issue is still important to you and still relevant with GTK+ 3.22 or master, please reopen it and we will migrate it to gitlab.
As announced a while ago, we are migrating to gitlab, and bugs that haven't seen activity in the last year or so will be not be migrated, but closed out in bugzilla. If this bug is still relevant to you, you can open a new issue describing the symptoms and how to reproduce it with gtk 3.22.x or master in gitlab: https://gitlab.gnome.org/GNOME/gtk/issues/new