[gnome-shell] altTab: Fix icon scrolling



commit 0f4ce5dd4e46dd441e59cca8a4ba6a01f2940d70
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Sep 7 05:23:04 2011 -0400

    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 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/altTab.js b/js/ui/altTab.js
index cbe6f6c..b6409e7 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();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]