GNOME Bugzilla – Bug 166829
Text tool dialog misbehaves when there is a floating selection
Last modified: 2007-05-24 01:28:44 UTC
Please describe the problem: Under specific circumstances, the thext selection dialog closes prematurely. Steps to reproduce: 1. Open an existing JPG file. 2. Select rectangular region. 3. Edit -> Copy. 4. File -> New. 5. Paste. 6. Add text to the new image. Actual results: After entering first character, the GIMP text editor dialog closes. Expected results: You can enter the whole text, not just one character. Does this happen every time? Yes. Other information: rpm -q gives: gimp-2.0.5-0.fc2.3
We're not maintaining GIMP 2.0 anymore, so I'm going to close this as WONTFIX. And in any case there were a bunch of font-related problems in 2.0.x that have been fixed in the meantime. So please upgrade to GIMP 2.2 and expect the problem to go away.
Actually, this is happens due to the floating selection that comes into existence when you paste. Until you either anchor that floating selection, or promote it to a new layer, not much can be performed on the image - and adding a new, unrelated layer (text layers even) are part of what one cannot do. The current behavior of floating selections in themselves is rather confusing, as one can see in bug 113477. However, IMHO, the text tool should either not display a dialog at all if the floating selection is active, or silently anchor the floating selection and proceed. Actually, I think the current behavior is buggy enough that it should be fixed even on the 2.2 branch. I am reoppening and changing summary accordingly.
It seems to me that the text tool should function equivalently how the paintbrush tool functions with the floating selection. I'm a member of the group that thinks that the floating selection is an anachronism from pre-layer times and is now more confusing that useful, but as long as we have the floating selection, operations on it should be consistant.
Sorry, but floating selections are still necessary. Perhaps not for all operations they are being used for but they are still necessary. Anyone who claims that they'd be an anachronism simply hasn't thought about it (or has a different solution and forgot to tell us about it).
Let's see... The text tool does actually anchor the floating selection. This does however happen implicitely at the moment the text layer is being added. This implicit action changes the undo stack and as a precaution the active tool is being cancelled. That's why the dialog is being closed.
This can be easily fixed by adding gimp_tool_control_set_preserve() around the critical operations.
My last comment was nonsense, just as Sven's comment #5 ;) The text tool itself listens to "active-layer-changed" of the image and resets itself. Anchoring the floating selection emits "active-layer-changed". Will commit a fix soonish.
Fixed in both branches: 2005-02-19 Michael Natterer <mitch@gimp.org> * app/tools/gimptexttool.c (gimp_text_tool_create_layer): block the "active-layer-changed" callback while anchoring the floating selection so the callback doesn't reset the text tool in the middle of adding a new text layer. Fixes bug #166829.