From 8ca25aed8b3d0340393e5222239183d5650bc549 Mon Sep 17 00:00:00 2001 From: Hashem Nasarat Date: Sun, 27 Jan 2013 14:00:59 -0500 Subject: [PATCH] viewSelector: stop launching app from empty search In the overview, when there is no text in the search entry, this._searchActive will be set to false. Moving the Clutter.Return code block ensures that pressing enter in the search field after deleting the characters of a search will no longer launch the #1 application for the previous search. https://bugzilla.gnome.org/show_bug.cgi?id=692391 --- js/ui/viewSelector.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js index c45057c9a..06cd436aa 100644 --- a/js/ui/viewSelector.js +++ b/js/ui/viewSelector.js @@ -368,15 +368,6 @@ const ViewSelector = new Lang.Class({ this.reset(); return true; } - } else if (symbol == Clutter.Return || symbol == Clutter.KP_Enter) { - // We can't connect to 'activate' here because search providers - // might want to do something with the modifiers in activateDefault. - if (this._searchTimeoutId > 0) { - Mainloop.source_remove(this._searchTimeoutId); - this._doSearch(); - } - this._searchResults.activateDefault(); - return true; } else if (this._searchActive) { let arrowNext, nextDirection; if (entry.get_text_direction() == Clutter.TextDirection.RTL) { @@ -401,6 +392,15 @@ const ViewSelector = new Lang.Class({ } else if (symbol == arrowNext && this._text.position == -1) { this._searchResults.navigateFocus(nextDirection); return true; + } else if (symbol == Clutter.Return || symbol == Clutter.KP_Enter) { + // We can't connect to 'activate' here because search providers + // might want to do something with the modifiers in activateDefault. + if (this._searchTimeoutId > 0) { + Mainloop.source_remove(this._searchTimeoutId); + this._doSearch(); + } + this._searchResults.activateDefault(); + return true; } } return false;