[gnome-shell] windowManager: Return the KeyBindingAction value from addKeybinding()



commit b7678493f9160b7e0d6dfce7c930538f8c4b39d7
Author: Rui Matos <tiagomatos gmail com>
Date:   Wed Dec 12 09:40:49 2012 +0100

    windowManager: Return the KeyBindingAction value from addKeybinding()
    
    meta_display_add_keybinding() returns a keybinding action ID for
    dynamically registered keybindings which can be used to match a
    keycode/mask pair to the action it is bound to.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=682315

 js/ui/windowManager.js |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
index 60e0837..35b6799 100644
--- a/js/ui/windowManager.js
+++ b/js/ui/windowManager.js
@@ -191,8 +191,10 @@ const WindowManager = new Lang.Class({
     },
 
     addKeybinding: function(name, settings, flags, modes, handler) {
-        if (global.display.add_keybinding(name, settings, flags, handler))
+        let action = global.display.add_keybinding(name, settings, flags, handler);
+        if (action != Meta.KeyBindingAction.NONE)
             this.allowKeybinding(name, modes);
+        return action;
     },
 
     removeKeybinding: function(name) {



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