- From: Federico Mena Quintero <federico ximian com>
- To: GTK+ development mailing list <gtk-devel-list gnome org>
- Subject: #101293, again
- Date: Wed, 10 Dec 2003 21:35:10 -0600
Please see http://bugzilla.gnome.org/show_bug.cgi?id=101293
People are used to hitting Esc to close dialog boxes. GNOME 1.x sucked
in this respect, we fixed it with GTK+ 2.0, then broke it again.
There is an ambiguous (ir)rationale that says "but there is a difference
between Cancel and Close, and Esc should refer to Cancel only".
It is very likely that dialogs that have a Close button rather than a
Cancel one are either
* instant-apply, in which case there's no explicit way to revert the
changes unless you have a Revert button, or
* transient windows that should not be dialog boxes, *or* things like
Find dialogs which you really really want to close if you hit Esc ---
how many times have you hit C-f, expecting the cursor to move forward,
and gotten a impossible-to-close Find dialog instead?
Even in the case of instant-apply dialogs, I'm sure there is no harm in
closing them when you hit Escape.
As yet another example of how super-annoying this is, hit Help/About on
a random app. GnomeAbout has a Close button with GTK_RESPONSE_CLOSE, so
you can't dismiss the @#$% About dialog with Escape.
We can do this easily:
1. Remove dialog_has_cancel() from gtkdialog.c
2. Bind Escape to the "close" signal.
3. Make the default handler for "close" just close the window with the
existing code that synthesizes a GDK_DELETE event. "close" is already a
G_SIGNAL_RUN_LAST signal, so recalcitrant windows which really don't
want to be closed with Escape can easily connect to the signal and stop
May I do all of these?
Pretty please, with sugar on top?
] [Thread Prev