After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 138298 - Script-fu settings dialog does not take focus, appears underneath other windows
Script-fu settings dialog does not take focus, appears underneath other windows
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Backend: Win32
2.24.x
Other Windows
: Normal minor
: Small fix
Assigned To: gtk-win32 maintainers
gtk-bugs
: 673871 674028 707313 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-03-27 20:53 UTC by K
Modified: 2018-04-15 00:24 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description K 2004-03-27 20:53:31 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.
Comment 1 Sven Neumann 2004-03-28 11:55:20 UTC
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.
Comment 2 Michael Natterer 2004-03-30 21:16:46 UTC
Confirmed by Dov on #gimp. Seems to be Win32 specific.
Comment 3 Tor Lillqvist 2004-03-30 23:08:04 UTC
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.
Comment 4 Elijah Newren 2004-06-19 18:44:09 UTC
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.
Comment 5 Stuart Axon 2009-11-11 05:37:10 UTC
Confirming on Vista32, Gimp 2.6.7
Comment 6 GrafxUser 2012-04-13 09:35:03 UTC
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' ;-)
Comment 7 GrafxUser 2012-04-13 09:35:36 UTC
*** Bug 673871 has been marked as a duplicate of this bug. ***
Comment 8 Michael Schumacher 2012-05-28 11:06:30 UTC
*** Bug 674028 has been marked as a duplicate of this bug. ***
Comment 9 Michael Schumacher 2012-05-28 11:08:03 UTC
Bug #674028 states that this now only happens for the first time a script is used in GIMP.
Comment 10 Max Mustermann 2013-09-05 19:32:14 UTC
*** Bug 707313 has been marked as a duplicate of this bug. ***
Comment 11 Max Mustermann 2013-09-05 19:35:49 UTC
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.
Comment 12 Massimo 2015-12-09 16:31:09 UTC
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
Comment 13 Matthias Clasen 2018-02-10 05:04:57 UTC
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.
Comment 14 Matthias Clasen 2018-04-15 00:24:05 UTC
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