[gnome-documents/gnome-3-6] searchbar: also don't handle modifier events while hidden



commit 1186c7dbd3e4ac7e3c181c44bb9d7a06d6e2ccf7
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon Oct 15 13:49:52 2012 -0400

    searchbar: also don't handle modifier events while hidden
    
    Taken from similar code in Boxes.

 src/searchbar.js |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/searchbar.js b/src/searchbar.js
index 1efed52..c57b0ff 100644
--- a/src/searchbar.js
+++ b/src/searchbar.js
@@ -351,6 +351,7 @@ const Searchbar = new Lang.Class({
 
     _isKeynavEvent: function(event) {
         let keyval = event.get_keyval()[1];
+        let state = event.get_state()[1];
 
         if (keyval == Gdk.KEY_Tab ||
             keyval == Gdk.KEY_KP_Tab ||
@@ -370,7 +371,8 @@ const Searchbar = new Lang.Class({
             keyval == Gdk.KEY_Page_Up ||
             keyval == Gdk.KEY_KP_Page_Up ||
             keyval == Gdk.KEY_Page_Down ||
-            keyval == Gdk.KEY_KP_Page_Down)
+            keyval == Gdk.KEY_KP_Page_Down ||
+            (state & (Gdk.ModifierType.CONTROL_MASK | Gdk.ModifierType.MOD1_MASK) != 0))
             return true;
 
         return false;



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