[gnome-shell] viewSelector: remove the search entry's event grab



commit 3755783d41057ae69efc03957fb17430411bb1a2
Author: Dan Winship <danw gnome org>
Date:   Wed Feb 16 13:44:03 2011 -0500

    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 files changed, 5 insertions(+), 14 deletions(-)
---
diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js
index f3a9868..13f6847 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 () {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]