From cbd2188c044679bc0129c67e7c60236a8776967b Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Thu, 16 Aug 2012 22:12:23 +0200 Subject: [PATCH] MonitorConstraint: fix clamping monitor index I will test my patches, I promise. --- js/ui/layout.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/ui/layout.js b/js/ui/layout.js index c833a1bd5..333b80985 100644 --- a/js/ui/layout.js +++ b/js/ui/layout.js @@ -83,7 +83,7 @@ const MonitorConstraint = new Lang.Class({ if (this._primary) { monitor = Main.layoutManager.primaryMonitor; } else { - let index = Math.max(this._index, Main.layoutManager.monitors.length); + let index = Math.min(this._index, Main.layoutManager.monitors.length - 1); monitor = Main.layoutManager.monitors[index]; }