From 3755783d41057ae69efc03957fb17430411bb1a2 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Wed, 16 Feb 2011 13:44:03 -0500 Subject: [PATCH] viewSelector: remove the search entry's event grab The search entry was taking a sort of grab when it was in the focused-but-empty state, and would eat up most events for other actors (except, confusingly, for panel actors). The only bit of "modality" we really need here is that the entry is supposed to go back to the unfocused state if you click somewhere outside it when it was in the focused-but-empty state. So do that. https://bugzilla.gnome.org/show_bug.cgi?id=642502 --- js/ui/viewSelector.js | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js index f3a986898..13f6847d2 100644 --- a/js/ui/viewSelector.js +++ b/js/ui/viewSelector.js @@ -161,8 +161,6 @@ SearchTab.prototype = { }, _reset: function () { - this._entry.sync_hover(); - this._text.text = ''; // Return focus to the viewSelector @@ -262,18 +260,14 @@ SearchTab.prototype = { _onCapturedEvent: function(actor, event) { let source = event.get_source(); - let panelEvent = source && Main.panel.actor.contains(source); switch (event.type()) { case Clutter.EventType.BUTTON_PRESS: // the user clicked outside after activating the entry, but // with no search term entered - cancel the search - if (source != this._text && this._text.text == '') { + if (source != this._text && this._text.text == '') this._reset(); - // allow only panel events to continue - return !panelEvent; - } - return false; + break; case Clutter.EventType.KEY_PRESS: // If some "special" actor grabbed the focus (run // dialog, looking glass); we don't want to interfere @@ -305,13 +299,10 @@ SearchTab.prototype = { this._text.event(event, false); } - return false; - default: - // Suppress all other events outside the panel while the entry - // is activated and no search has been entered - any click - // outside the entry will cancel the search - return (this._text.text == '' && !panelEvent); + break; } + + return false; }, _doSearch: function () {