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 696961 - GtkSearchEntry should clear contents on Escape
GtkSearchEntry should clear contents on Escape
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkEntry
3.8.x
Other Linux
: Normal minor
: ---
Assigned To: Sindhu S
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-03-31 12:52 UTC by Adam Dingle
Modified: 2018-04-15 00:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Listen for Escape to clear the GtkSearchEntry contents (1.34 KB, patch)
2013-05-26 14:07 UTC, Sindhu S
needs-work Details | Review
Clear GtkSearchEntry on escape key (954 bytes, patch)
2015-03-06 21:40 UTC, Florian Richter
none Details | Review

Description Adam Dingle 2013-03-31 12:52:12 UTC
I think that when a GtkSearchEntry has focus and the user presses Escape, we should clear the search box, just as if the user had clicked the "clear" icon.
Comment 1 Sindhu S 2013-05-26 14:07:58 UTC
Created attachment 245333 [details] [review]
Listen for Escape to clear the GtkSearchEntry contents

Please review, Thanks.
Comment 2 Benjamin Otte (Company) 2013-05-27 12:01:39 UTC
some drive-by comments:

(1) Please don't use g_signal_connect() but rather overwrite widget_class->key_press_event

(2) This depends on UI review first so we know it's actually what we want. Also, should GtkEntry maybe do this already?
Comment 3 Sindhu S 2013-05-27 12:09:33 UTC
(In reply to comment #2)
> some drive-by comments:
> 
> (1) Please don't use g_signal_connect() but rather overwrite
> widget_class->key_press_eventeful

OK. I will try that in the next iteration of my patch.

> (2) This depends on UI review first so we know it's actually what we want.
> Also, should GtkEntry maybe do this already?

Simple GtkEntry should also clear contents upon Escape? I don't think that's the desired behaviour. 

Escape to clear contents is particularly useful in a GtkSearchEntry because the user maybe looking for many things or may be unsuccessful in finding an instance of a word in a search and hence would need to modify his search query often, so a keybinding to clear the GtkSearchEntry would make the UI that much more convenient.

I will check if GtkEntry has this feature already and report back.

Thank you for the comments, Benjamin!
Comment 4 Matthias Clasen 2014-12-08 04:42:51 UTC
Review of attachment 245333 [details] [review]:

set patch status according to Benjamins comments
Comment 5 Florian Richter 2015-03-06 21:40:35 UTC
Created attachment 298751 [details] [review]
Clear GtkSearchEntry on escape key

GNOME Software already does this. Maps and others could profit from this.

I think this feature shouldn't be in GtkEntry. The escape key normally corresponds to an action, which is to be aborted and GtkEntry doesn't represent that. E. g. in a dialog the whole dialog should be closed when pressing escape. However aborting a search normally means to remove the filter.
Comment 6 Matthias Clasen 2015-03-08 12:50:29 UTC
I must say that I prefer to keep it the way that it is now, with the entry emitting signals, but it is the applications responsibility to change the contents.
Comment 7 Adam Dingle 2015-03-08 13:01:11 UTC
I filed this originally, and don't feel strongly about at it all.  If the GTK team thinks this is best left as is, that's fine with me.
Comment 8 Matthias Clasen 2018-02-10 05:14:29 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 9 Matthias Clasen 2018-04-15 00:03:14 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