altTab: Don't activate an app it the icon is no longer available

https://bugzilla.gnome.org/show_bug.cgi?id=620106
This commit is contained in:
Mario Sanchez Prada 2017-11-30 20:53:39 +00:00
parent e608d4f26b
commit 815302b4ac

View File

@ -254,11 +254,12 @@ var AppSwitcherPopup = new Lang.Class({
_finish : function(timestamp) { _finish : function(timestamp) {
let appIcon = this._items[this._selectedIndex]; let appIcon = this._items[this._selectedIndex];
if (this._currentWindow < 0) if (appIcon) {
appIcon.app.activate_window(appIcon.cachedWindows[0], timestamp); if (this._currentWindow < 0)
else if (appIcon.cachedWindows[this._currentWindow]) appIcon.app.activate_window(appIcon.cachedWindows[0], timestamp);
Main.activateWindow(appIcon.cachedWindows[this._currentWindow], timestamp); else if (appIcon.cachedWindows[this._currentWindow])
Main.activateWindow(appIcon.cachedWindows[this._currentWindow], timestamp);
}
this.parent(); this.parent();
}, },