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 692391 - Pressing Return in empty Search field should not launch an application
Pressing Return in empty Search field should not launch an application
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
3.6.x
Other Linux
: Normal normal
: ---
Assigned To: Hashem Nasarat
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2013-01-23 14:36 UTC by Age Bosma (IRC: Forage)
Modified: 2013-01-28 15:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to check if search entry is empty (1.08 KB, patch)
2013-01-26 18:00 UTC, Hashem Nasarat
needs-work Details | Review
Patch refactor where the Clutter.Return code block is run (2.35 KB, patch)
2013-01-27 19:08 UTC, Hashem Nasarat
committed Details | Review

Description Age Bosma (IRC: Forage) 2013-01-23 14:36:36 UTC
When starting to type in the application overview, it functions as a search query. When you remove the typed characters, using backspace, and hit Return in an empty Search field, it will still launch an application that sort of "matches" with the last character that was present in the field. I think this behaviour is incorrect. One can't really predict which application will be launched and as a result causes "random" behaviour. Instead it should just close the application overview. You ask it to do something on nothing, not on something that was. One could say that it should therefore not close the overview as well...but then you'd loose a handy shortcut ;-)
Comment 1 Hashem Nasarat 2013-01-24 02:39:12 UTC
I'd like to work on fixing this.
Comment 2 Hashem Nasarat 2013-01-26 18:00:17 UTC
Created attachment 234485 [details] [review]
Patch to check if search entry is empty

All done! With this patch, pressing enter in an empty search field will not launch an app and it will not close the overview. I believe this is the proper functionality since enter doesn't do anything else in the shell and it would be weird for it to function as a shortcut to close the overview only in the search field.
Comment 3 Rui Matos 2013-01-27 18:14:56 UTC
Review of attachment 234485 [details] [review]:

Thanks for the patch. I'd rather move the whole

if (symbol == Clutter.Return || symbol == Clutter.KP_Enter) {
...
}

block inside the if (this._searchActive) {} block.
Comment 4 Hashem Nasarat 2013-01-27 19:08:08 UTC
Created attachment 234560 [details] [review]
Patch refactor where the Clutter.Return code block is run

This is a bit cleaner; good idea.
Comment 5 Rui Matos 2013-01-27 19:25:26 UTC
Review of attachment 234560 [details] [review]:

Looks good. Do you have git access to push?
Comment 6 Hashem Nasarat 2013-01-27 19:27:02 UTC
Not yet. Will you commit it for me?
(Thanks, if so)
Comment 7 Rui Matos 2013-01-27 19:32:35 UTC
(In reply to comment #6)
> Not yet. Will you commit it for me?
> (Thanks, if so)

Sure, you're welcome. Keep them coming :-)
Comment 8 Age Bosma (IRC: Forage) 2013-01-28 15:58:45 UTC
Nice, a quick fix, thanks Hashem!