Skip to content

Commit 327043a

Browse files
committed
appswitcher: Fix Alt+Shift+Tab (13717)
Update _show and _keyReleaseEvent to detect backward keybindings.
1 parent a9cf0e0 commit 327043a

3 files changed

Lines changed: 18 additions & 6 deletions

File tree

js/ui/appSwitcher/appSwitcher.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,13 @@ AppSwitcher.prototype = {
341341
let state = mods & this._modifierMask;
342342

343343
if (state == 0) {
344-
if (this._initialDelayTimeoutId !== 0)
345-
this._currentIndex = (this._currentIndex + 1) % this._windows.length;
344+
if (this._initialDelayTimeoutId !== 0) {
345+
let name = this._binding ? this._binding.get_name() : '';
346+
if (name.includes('backward'))
347+
this._currentIndex = (this._currentIndex - 1 + this._windows.length) % this._windows.length;
348+
else
349+
this._currentIndex = (this._currentIndex + 1) % this._windows.length;
350+
}
346351
this._activateSelected();
347352
}
348353

js/ui/appSwitcher/appSwitcher3D.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ AppSwitcher3D.prototype = {
5555

5656
_show: function() {
5757
this._enableMonitorFix();
58-
58+
let [x, y, modifiers] = global.get_pointer();
5959
let monitor = this._activeMonitor;
6060
this.actor.set_position(monitor.x, monitor.y);
6161
this.actor.set_size(monitor.width, monitor.height);
@@ -78,7 +78,10 @@ AppSwitcher3D.prototype = {
7878

7979
this._initialDelayTimeoutId = 0;
8080

81-
this._next();
81+
if (modifiers & Clutter.ModifierType.SHIFT_MASK)
82+
this._previous();
83+
else
84+
this._next();
8285
},
8386

8487
_hidePreviews: function(endOpacity) {

js/ui/appSwitcher/classicSwitcher.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,14 @@ ClassicSwitcher.prototype = {
139139

140140
_show: function() {
141141
Main.panelManager.panels.forEach(function(panel) { panel.actor.set_reactive(false); });
142-
142+
let [x, y, modifiers] = global.get_pointer();
143143
this.actor.opacity = 255;
144144
this._initialDelayTimeoutId = 0;
145-
this._next();
145+
146+
if (modifiers & Clutter.ModifierType.SHIFT_MASK)
147+
this._previous();
148+
else
149+
this._next();
146150
},
147151

148152
_hide: function() {

0 commit comments

Comments
 (0)