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 166012 - Don't use the minimized toolbox as parent widget for image-related dialogs
Don't use the minimized toolbox as parent widget for image-related dialogs
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: User Interface
2.2.x
Other All
: Normal normal
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2005-02-02 08:18 UTC by jbwyatt4
Modified: 2008-01-15 12:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description jbwyatt4 2005-02-02 08:18:47 UTC
1 Minimize the Gimp toolbar & create/open a image
2 Click new layer through the menu on the mouse.

My guess
The new layer dialog will not come up because it's minimized with the Gimp
toolbar. The Gimp toolbar is right not occupied with trying to show the new
layer dialog so it won't respond.
Comment 1 Michael Schumacher 2005-02-02 08:40:03 UTC
Confirmed with 2.2.3 on Windows XP.
Comment 2 Michael Natterer 2005-02-02 12:54:13 UTC
So what exactly is happening here? I don't follow.
Comment 3 Sven Neumann 2005-02-02 14:39:25 UTC
I can also not make any sense out of this bug report. Let's see... "Gimp
toolbar" probably means the toolbox, right? What exactly do you mean with "Click
new layer through the menu on the mouse"? That doesn't seem to make any sense.
And why should a "new layer dialog" be displayed?
Comment 4 Michael Schumacher 2005-02-02 14:47:21 UTC
Steps to reproduce:

1) Open a new image
2) Minimize the toolbox
3) Go to Layer->New layer in the context menu - this only happens with the image
context menu, it works fine with the image menu and the layers dialog context
window.

Result:
The new layer dialog doesn't open. Additionally, it is now impossible to restore
the toolbox from the taskbar again.

Expected result:
The dialog appears, and the toolbox can be minimized and restored without problems.

Comment 5 jbwyatt4 2005-02-03 03:05:54 UTC
Thanks to Michael Schumacher for putting it into better words.

(I need to work on my bug reporting)
Comment 6 Raphaël Quinet 2005-02-03 16:52:08 UTC
I tried it on a Debian system and the root cause of the problem is obvious once
you compare what happens when selecting New Layer from the context menu and
from the image menu or layers dialog.  When using the context menu (<Image> ->
Layer -> New layer), the "New Layer" dialog will not pop up because it has the
toolbox as its parent.  De-iconifying the toolbox solves the problem: both the
toolbox and the "New Layer" dialog show up.

So the bug seems to affect all OSs.  It is only a minor annoyance for many
systems, but it seems to cause a deadlock for Windows.  It could be fixed by
ensuring that the "New Layer" dialog is tied to the image window instead of
the toolbox when it is invoked from the context menu.

By the way, it seems that other dialogs could have the same problem:
  <Image> -> Edit -> Buffer -> Cut Named...
  <Image> -> Edit -> Buffer -> Copy Named...
  <Image> -> Mode -> Indexed...
  <Image> -> Image -> Canvas Size...  (but not Scale Image)
  <Image> -> Image -> Print Size...
  <Image> -> Layer -> Mask -> Add Layer Mask...
  <Image> -> Layer -> Transform -> Offset...
  <Image> -> Layer -> Layer Boundary Size...
  <Image> -> Layer -> Scale Layer...
That's about all I could find.  Note that using the same features from the image
menu, from a shortcut or from the layer dialog (button or context menu) works
fine.  The problem occurs only from the image context menu.
Comment 7 Michael Natterer 2005-02-03 17:27:46 UTC
*All* dialogs invoked from the <Image> popup have this problem.

I recently changed HEAD to do exactly that: separating
the <Image> and <Toolbox> menus into different UI managers
to make sure that action_data_get_widget() returns the display
shell instead of the toolbox when called from an <Image> popup
callback.

I just need to do the actual change in action_data_get_widget().

Backporting this whole stuff to 2.2 doesn't feel comfortable though.
Perhaps we should let the dialogs get their parent widget from
the display, not from action_data_get_widget().
Comment 8 Michael Natterer 2005-02-03 17:42:42 UTC
When fixing this, we should also consider minimized image windows.
After all, the menus could be torn off and the active display invisible.

Maybe some generic code in GimpDialog::map() to unminimize the
parent widget?
Comment 9 Raphaël Quinet 2005-02-03 18:02:33 UTC
Re comment #7: not all dialogs.  Try to test with the stable branch and compare
Image -> Canvas Size (parent is the toolbox) and Image -> Scale Image (parent is
the image window).

Re comment #8: you are right about detached menus (I just tested this and it
produces funny results) but this is probably less likely to happen.

For detached menus, unminimizing the parent widget might make sense.  However,
this is only appropriate if you are sure that your recent changes in HEAD will
always cause the right parent to be used.  Otherwise, the user would be annoyed
if the toolbox or some other window suddenly pops up.
Comment 10 Michael Natterer 2005-02-03 18:24:06 UTC
The changes in HEAD were made to ensure exactly this (among other things).

Did you try both menu entries from the popup? The callbacks get their
parent widget exactly the same way and should both use the toolbox.
Comment 11 Michael Natterer 2005-02-03 18:27:52 UTC
Heh, you are right, image_scale_dialog_new() doesn't use the passed
parent widget at all but uses gdisp->shell instead :-)
Comment 12 Raphaël Quinet 2005-02-03 18:34:56 UTC
Yes, I tried them both from the context menu and I was very surprised that
they behaved differently (that's why I mentioned it in comment #6).  So if I
take the CVS stable branch or the Debian build of 2.2.2 and I open the
Canvas Size or the Scale Image dialog from the context menu, one of them is
tied to the toolbox and the other one is tied to the image window.  The right
parent (image window) is also picked by other dialogs such as the display
filters, create new template, etc.

It's funny to discover these inconsistencies in the code now...
Comment 13 Michael Natterer 2005-02-03 18:36:11 UTC
Made the scale dialog correctly be affected by this bug too:

2005-02-03  Michael Natterer  <mitch@gimp.org>

	* app/dialogs/image-scale-dialog.c (image_scale_dialog_new): use
	the passed parent widget instead of display->shell.
Comment 14 Michael Natterer 2005-02-08 21:20:41 UTC
Fixed in HEAD. The fix for 2.2 is far more complicated and ugly
and still half-finished on my disk.

2005-02-08  Michael Natterer  <mitch@gimp.org>

	* app/actions/actions.c (action_data_get_widget): return the
	active display's shell instead of the toolbox when called from the
	<Image> popup. Fall back to the toolbox if there is no active
	display. Fixes bug #166012.
Comment 15 Sven Neumann 2005-03-14 14:24:20 UTC
Shouldn't GTK+ care about minimized parent windows? I suggest that we check for
GTK+ bug reports and if there isn't one, then reassign this (or perhaps bug
#169965) to GTK+.
Comment 16 Michael Schumacher 2006-04-15 20:55:16 UTC
Bug 169965 comment #9 suggests that this has to be solved at the toolkit and/or WM level, depending on the platform. Does this one qualify as a duplicate?
Comment 17 weskaggs 2006-05-19 16:18:43 UTC
Since this is fixed in HEAD and 2.4 is fast approaching, I am going to reset the target to 2.4 and declare it FIXED for purposes of Bugzilla housekeeping -- which should not prevent mitch from continuing to backport it if he wants to.