MonitorConstraint: fix clamping monitor index

I will test my patches, I promise.
This commit is contained in:
Giovanni Campagna 2012-08-16 22:12:23 +02:00
parent 2b30afa618
commit cbd2188c04

View File

@ -83,7 +83,7 @@ const MonitorConstraint = new Lang.Class({
if (this._primary) { if (this._primary) {
monitor = Main.layoutManager.primaryMonitor; monitor = Main.layoutManager.primaryMonitor;
} else { } 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]; monitor = Main.layoutManager.monitors[index];
} }