alternate-tab: port to the new keybindings infrastructure

Keybindings were refactored in 3.7.2, to allow handling them
while the shell is modal, and now require a set of flags indicating
the "allowed modes"
This commit is contained in:
Giovanni Campagna
2012-11-20 16:20:10 +01:00
parent aa677b265a
commit f8ee696c7c
+12 -8
View File
@@ -428,16 +428,20 @@ function init(metadata) {
settings = Convenience.getSettings();
}
function setKeybinding(name, func) {
Main.wm.setCustomKeybindingHandler(name, Main.KeybindingMode.NORMAL, func);
}
function enable() {
Meta.keybindings_set_custom_handler('switch-windows', doAltTab);
Meta.keybindings_set_custom_handler('switch-group', doAltTab);
Meta.keybindings_set_custom_handler('switch-windows-backward', doAltTab);
Meta.keybindings_set_custom_handler('switch-group-backward', doAltTab);
setKeybinding('switch-windows', doAltTab);
setKeybinding('switch-group', doAltTab);
setKeybinding('switch-windows-backward', doAltTab);
setKeybinding('switch-group-backward', doAltTab);
}
function disable() {
Meta.keybindings_set_custom_handler('switch-windows', Lang.bind(Main.wm, Main.wm._startAppSwitcher));
Meta.keybindings_set_custom_handler('switch-group', Lang.bind(Main.wm, Main.wm._startAppSwitcher));
Meta.keybindings_set_custom_handler('switch-windows-backward', Lang.bind(Main.wm, Main.wm._startAppSwitcher));
Meta.keybindings_set_custom_handler('switch-group-backward', Lang.bind(Main.wm, Main.wm._startAppSwitcher));
setKeybinding('switch-windows', Lang.bind(Main.wm, Main.wm._startAppSwitcher));
setKeybinding('switch-group', Lang.bind(Main.wm, Main.wm._startAppSwitcher));
setKeybinding('switch-windows-backward', Lang.bind(Main.wm, Main.wm._startAppSwitcher));
setKeybinding('switch-group-backward', Lang.bind(Main.wm, Main.wm._startAppSwitcher));
}