[gnome-shell-extensions] alternate-tab: don't assume that at least two windows exist
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell-extensions] alternate-tab: don't assume that at least two windows exist
- Date: Wed, 29 Aug 2012 00:06:02 +0000 (UTC)
commit 45da997dd376eae2a529aa8683b3b4e028c9e7f8
Author: Giovanni Campagna <gcampagna src gnome org>
Date: Mon Aug 27 14:25:01 2012 +0200
alternate-tab: don't assume that at least two windows exist
Initial selection would go out of the array bounds if only one window
existed.
extensions/alternate-tab/extension.js | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/extensions/alternate-tab/extension.js b/extensions/alternate-tab/extension.js
index c37a594..232b8c7 100644
--- a/extensions/alternate-tab/extension.js
+++ b/extensions/alternate-tab/extension.js
@@ -149,10 +149,11 @@ const AltTabPopup = new Lang.Class({
this._appSwitcher.connect('item-entered', Lang.bind(this, this._windowEntered));
// make the initial selection
+ this._currentWindow = 0;
if (backward)
- this._select(windows.length - 1);
+ this._select(this._previousWindow());
else
- this._select(1);
+ this._select(this._nextWindow());
this.actor.opacity = 0;
this.actor.show();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]