[gnome-documents] searchbar: ignore action-state-changed signals which are not for us



commit 0cb97dce5b61a699afccd3c1af3b0204a9dcec9f
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Thu Jan 10 18:30:16 2013 -0500

    searchbar: ignore action-state-changed signals which are not for us
    
    I'm pretty sure this is a regression lower in the stack, probably GLib
    or GJS; we connect to the detailed 'action-state-changed::search' signal
    on the GApplication action group, but our callback is also invoked when
    other action's state changes.
    Workaround this by ignoring all the emissions that are not for us.

 src/searchbar.js |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/searchbar.js b/src/searchbar.js
index b50b51d..f22317b 100644
--- a/src/searchbar.js
+++ b/src/searchbar.js
@@ -112,6 +112,9 @@ const Searchbar = new Lang.Class({
     },
 
     _onActionStateChanged: function(source, actionName, state) {
+        if (actionName != 'search')
+            return;
+
         if (state.get_boolean())
             this.show();
         else



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