altTab: honor switch_*_backward key binding actions

https://bugzilla.gnome.org/show_bug.cgi?id=650452
This commit is contained in:
Rui Matos 2011-07-05 23:05:45 +01:00 committed by Dan Winship
parent 1dfffdbc4e
commit 8db1ff8aef
2 changed files with 13 additions and 3 deletions

View File

@ -119,7 +119,7 @@ AltTabPopup.prototype = {
}
},
show : function(backward, switch_group) {
show : function(backward, binding) {
let tracker = Shell.WindowTracker.get_default();
let apps = tracker.get_running_apps ('');
@ -150,7 +150,7 @@ AltTabPopup.prototype = {
this.actor.get_allocation_box();
// Make the initial selection
if (switch_group) {
if (binding == 'switch_group') {
if (backward) {
this._select(0, this._appIcons[0].cachedWindows.length - 1);
} else {
@ -159,6 +159,10 @@ AltTabPopup.prototype = {
else
this._select(0, 0);
}
} else if (binding == 'switch_group_backward') {
this._select(0, this._appIcons[0].cachedWindows.length - 1);
} else if (binding == 'switch_windows_backward') {
this._select(this._appIcons.length - 1);
} else if (this._appIcons.length == 1) {
this._select(0);
} else if (backward) {
@ -221,8 +225,12 @@ AltTabPopup.prototype = {
this.destroy();
} else if (action == Meta.KeyBindingAction.SWITCH_GROUP) {
this._select(this._currentApp, backwards ? this._previousWindow() : this._nextWindow());
} else if (action == Meta.KeyBindingAction.SWITCH_GROUP_BACKWARD) {
this._select(this._currentApp, this._previousWindow());
} else if (action == Meta.KeyBindingAction.SWITCH_WINDOWS) {
this._select(backwards ? this._previousApp() : this._nextApp());
} else if (action == Meta.KeyBindingAction.SWITCH_WINDOWS_BACKWARD) {
this._select(this._previousApp());
} else if (this._thumbnailsFocused) {
if (keysym == Clutter.Left)
this._select(this._currentApp, this._previousWindow());

View File

@ -119,6 +119,8 @@ WindowManager.prototype = {
this.setKeybindingHandler('switch_to_workspace_down', Lang.bind(this, this._showWorkspaceSwitcher));
this.setKeybindingHandler('switch_windows', Lang.bind(this, this._startAppSwitcher));
this.setKeybindingHandler('switch_group', Lang.bind(this, this._startAppSwitcher));
this.setKeybindingHandler('switch_windows_backward', Lang.bind(this, this._startAppSwitcher));
this.setKeybindingHandler('switch_group_backward', Lang.bind(this, this._startAppSwitcher));
this.setKeybindingHandler('switch_panels', Lang.bind(this, this._startA11ySwitcher));
Main.overview.connect('showing', Lang.bind(this, function() {
@ -534,7 +536,7 @@ WindowManager.prototype = {
let tabPopup = new AltTab.AltTabPopup();
if (!tabPopup.show(backwards, binding == 'switch_group'))
if (!tabPopup.show(backwards, binding))
tabPopup.destroy();
},