From 0f4ce5dd4e46dd441e59cca8a4ba6a01f2940d70 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Wed, 7 Sep 2011 05:23:04 -0400 Subject: [PATCH] altTab: Fix icon scrolling Don't depend on the primary monitor position for determining whether we should scroll, just use our own container's size. https://bugzilla.gnome.org/show_bug.cgi?id=658239 --- js/ui/altTab.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/js/ui/altTab.js b/js/ui/altTab.js index cbe6f6c48..b6409e744 100644 --- a/js/ui/altTab.js +++ b/js/ui/altTab.js @@ -636,11 +636,10 @@ SwitcherList.prototype = { this._items[this._highlighted].add_style_pseudo_class('selected'); } - let monitor = Main.layoutManager.primaryMonitor; - let itemSize = this._items[index].allocation.x2 - this._items[index].allocation.x1; - let [posX, posY] = this._items[index].get_transformed_position(); - posX += this.actor.x; - if (posX + itemSize > monitor.width + monitor.x) + let [absItemX, absItemY] = this._items[index].get_transformed_position(); + let [result, posX, posY] = this.actor.transform_stage_point(absItemX, 0); + let [containerWidth, containerHeight] = this.actor.get_transformed_size(); + if (posX + this._items[index].get_width() > containerWidth) this._scrollToRight(); else if (posX < 0) this._scrollToLeft();