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 148026 - Set the activates-default property on entries in dialogs
Set the activates-default property on entries in dialogs
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: User Interface
git master
Other All
: Normal minor
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
: 165748 303583 329005 343583 360380 376435 432224 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-07-20 19:35 UTC by Federico Mena Quintero
Modified: 2007-04-22 12:06 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Federico Mena Quintero 2004-07-20 19:35:19 UTC
The Scale Image dialog doesn't have OK set as the default button.  It would be
nice to have this, to be able to press Enter to close the dialog and perform the
scaling.
Comment 1 Michael Natterer 2004-07-21 15:57:29 UTC
The OK button is the default button. It's the spinbuttons that
don't have the GtkEntry::activates-default property set.

We should probably agree on a policy to implement in all
GIMP dialogs instead of changing this individual one...
Comment 2 Sven Neumann 2004-07-21 16:11:57 UTC
This is hardly doable. Pressing Enter in a spinbutton accepts the entered value
which is then (in almost all GIMP dialogs) used to updated related fields (for
example a spinbutton coupled to this one via a chain-button). It would be wrong
to just close the dialog as if the OK button was pressed. I suggest resolving as
NOTABUG.
Comment 3 Federico Mena Quintero 2004-07-21 16:53:06 UTC
Pressing return or enter in a spin button does this:

1. gtk_spin_button_update() - so the value is committed, and it emits the
value_changed signal; I assume that in the callback for that is where you update
the other spin buttons.

2. It calls the parent's activate handler; here is where GtkEntry would activate
the default button in the dialog.

It would work just fine.
Comment 4 Sven Neumann 2004-07-21 17:12:14 UTC
No, it wouldn't. When the dialog is closed the action that is performed must
match what the user sees when she closes the dialog. So we can't implement it
the way you suggest since that would mean that pressing Enter would not perform
the action indicated by the visible state of the dialog. This would lead to
major confusion.
Comment 5 weskaggs 2004-07-22 15:46:01 UTC
I agree with Sven.  In fact, whenever there are multiple numerical entries, it
is wrong to activate the default action when Return is pressed in one of them. 
This is because there are still many poorly written programs out there --
including gtk programs -- that don't recognize that an entry has been changed
unless you hit Return after changing it, so some users when in doubt tend to hit
Return just to make sure.
Comment 6 Federico Mena Quintero 2004-07-22 22:20:01 UTC
Oh, I see Sven's point.

Would it be reasonable to focus the next spin button when one gets activated by
pressing Return?

("What does Photoshop do?")
Comment 7 Dave Neary 2004-07-23 10:24:55 UTC
How about just setting the focus on the "OK" button when pressing enter in the
spinbox? That way, two returns and you're done.

Dave.
Comment 8 Federico Mena Quintero 2004-07-23 17:39:48 UTC
Dave, I guess that would work nicely.
Comment 9 Michael Natterer 2004-07-26 13:52:18 UTC
Both options (focussing the next entry and focussing the default button)
sound quite nice. However, isn't this something that should be implemented
in a generic way, using the GTK+ focus chain?
Comment 10 Michael Natterer 2004-09-14 12:37:44 UTC
Set the property where it is obviously right:

2004-09-14  Michael Natterer  <mitch@gimp.org>

	* libgimpwidgets/gimpquerybox.c: set the "activates-default"
	property on the entries in all query boxes so hitting "return"
	confirms them. Addresses bug #148026.
Comment 11 Michael Natterer 2004-09-15 15:07:17 UTC
More of them:

2004-09-15  Michael Natterer  <mitch@gimp.org>

	(...)

	* app/actions/channels-commands.c
	* app/actions/layers-commands.c
	* app/actions/vectors-commands.c: set the "activates-default"
	property on the name entry in all "New Foo" and "Edit Foo
	Attributes" dialogs except in the "New Layer" dialog.
	Addresses bug #148026.
Comment 12 Michael Natterer 2005-05-08 17:22:20 UTC
*** Bug 165748 has been marked as a duplicate of this bug. ***
Comment 13 Michael Natterer 2005-05-08 17:28:38 UTC
We should at least try to get this correctly in all dialogs for 2.4
Comment 14 Sven Neumann 2005-05-08 20:41:26 UTC
At least the Layer New dialog which has been mentioned does intentionally not
set "activates-default".
Comment 15 Michael Schumacher 2005-05-09 17:07:57 UTC
*** Bug 303583 has been marked as a duplicate of this bug. ***
Comment 16 Sven Neumann 2005-10-19 10:15:12 UTC
It would be very helpful if someone could collect a list of dialogs that still
need this change.
Comment 17 Michael Schumacher 2006-01-29 10:55:58 UTC
*** Bug 329005 has been marked as a duplicate of this bug. ***
Comment 18 weskaggs 2006-05-20 23:12:35 UTC
Bumping to Future, because with the progress that has been made, this is no longer a blocker for 2.4.
Comment 19 Sven Neumann 2006-05-29 15:53:56 UTC
Closing as FIXED because I think that we have changed all relevant places and it doesn't make sense to keep this open just in case that we missed one.
Comment 20 Michael Natterer 2006-06-01 14:15:55 UTC
*** Bug 343583 has been marked as a duplicate of this bug. ***
Comment 21 Sven Neumann 2006-10-09 13:10:10 UTC
*** Bug 360380 has been marked as a duplicate of this bug. ***
Comment 22 Sven Neumann 2006-11-18 14:58:44 UTC
*** Bug 376435 has been marked as a duplicate of this bug. ***
Comment 23 Michael Natterer 2007-04-22 12:06:53 UTC
*** Bug 432224 has been marked as a duplicate of this bug. ***