From b7678493f9160b7e0d6dfce7c930538f8c4b39d7 Mon Sep 17 00:00:00 2001 From: Rui Matos Date: Wed, 12 Dec 2012 09:40:49 +0100 Subject: [PATCH] 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 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js index 60e0837ae..35b67992b 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) {