diff --git a/js/ui/search.js b/js/ui/search.js index c399880f5..30e2b301d 100644 --- a/js/ui/search.js +++ b/js/ui/search.js @@ -681,6 +681,15 @@ var SearchResults = new Lang.Class({ this._setSelected(this._defaultResult, highlight); }, + popupMenuDefault: function() { + // If we have a search queued up, force the search now. + if (this._searchTimeoutId > 0) + this._doSearch(); + + if (this._defaultResult) + this._defaultResult.actor.popup_menu(); + }, + navigateFocus: function(direction) { let rtl = this.actor.get_text_direction() == Clutter.TextDirection.RTL; if (direction == Gtk.DirectionType.TAB_BACKWARD || diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js index ba7f46c71..7131f77bd 100644 --- a/js/ui/viewSelector.js +++ b/js/ui/viewSelector.js @@ -163,6 +163,13 @@ var ViewSelector = new Lang.Class({ this._text.connect('key-focus-out', Lang.bind(this, function() { this._searchResults.highlightDefault(false); })); + this._entry.connect('popup-menu', () => { + if (!this._searchActive) + return; + + this._entry.menu.close(); + this._searchResults.popupMenuDefault(); + }); this._entry.connect('notify::mapped', Lang.bind(this, this._onMapped)); global.stage.connect('notify::key-focus', Lang.bind(this, this._onStageKeyFocusChanged));