altTab: enable the switch_group keybinding action

Allows the user to bring up the Alt+Tab popup with the current application's
window thumbnails selected.

https://bugzilla.gnome.org/show_bug.cgi?id=639341
This commit is contained in:
Rui Matos 2011-01-29 22:11:25 +00:00 committed by Dan Winship
parent c2ae95f912
commit a047132a2f
2 changed files with 13 additions and 3 deletions

View File

@ -120,7 +120,7 @@ AltTabPopup.prototype = {
} }
}, },
show : function(backward) { show : function(backward, switch_group) {
let tracker = Shell.WindowTracker.get_default(); let tracker = Shell.WindowTracker.get_default();
let apps = tracker.get_running_apps (''); let apps = tracker.get_running_apps ('');
@ -145,7 +145,16 @@ AltTabPopup.prototype = {
this._appIcons = this._appSwitcher.icons; this._appIcons = this._appSwitcher.icons;
// Make the initial selection // Make the initial selection
if (this._appIcons.length == 1) { if (switch_group) {
if (backward) {
this._select(0, this._appIcons[0].cachedWindows.length - 1);
} else {
if (this._appIcons[0].cachedWindows.length > 1)
this._select(0, 1);
else
this._select(0, 0);
}
} else if (this._appIcons.length == 1) {
if (!backward && this._appIcons[0].cachedWindows.length > 1) { if (!backward && this._appIcons[0].cachedWindows.length > 1) {
// For compatibility with the multi-app case below // For compatibility with the multi-app case below
this._select(0, 1, true); this._select(0, 1, true);

View File

@ -116,6 +116,7 @@ WindowManager.prototype = {
this.setKeybindingHandler('switch_to_workspace_up', Lang.bind(this, this._showWorkspaceSwitcher)); this.setKeybindingHandler('switch_to_workspace_up', Lang.bind(this, this._showWorkspaceSwitcher));
this.setKeybindingHandler('switch_to_workspace_down', Lang.bind(this, this._showWorkspaceSwitcher)); this.setKeybindingHandler('switch_to_workspace_down', Lang.bind(this, this._showWorkspaceSwitcher));
this.setKeybindingHandler('switch_windows', Lang.bind(this, this._startAppSwitcher)); this.setKeybindingHandler('switch_windows', Lang.bind(this, this._startAppSwitcher));
this.setKeybindingHandler('switch_group', Lang.bind(this, this._startAppSwitcher));
Main.overview.connect('showing', Lang.bind(this, function() { Main.overview.connect('showing', Lang.bind(this, function() {
for (let i = 0; i < this._dimmedWindows.length; i++) for (let i = 0; i < this._dimmedWindows.length; i++)
@ -520,7 +521,7 @@ WindowManager.prototype = {
let tabPopup = new AltTab.AltTabPopup(); let tabPopup = new AltTab.AltTabPopup();
if (!tabPopup.show(backwards)) if (!tabPopup.show(backwards, binding == 'switch_group'))
tabPopup.destroy(); tabPopup.destroy();
}, },