[gnome-shell] Revert "[appSwitcher] Remove unneeded workaround"



commit 362fc78dcf2532b7d4e721732f1ba46838124631
Author: Adel Gadllah <adel gadllah gmail com>
Date:   Thu Jun 17 17:17:57 2010 +0200

    Revert "[appSwitcher] Remove unneeded workaround"
    
    This reverts commit a1bfaac5a21010843a4d7e4206b2fed92b2f6e59.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=613194

 js/ui/altTab.js |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/altTab.js b/js/ui/altTab.js
index 028dc5b..d1b967e 100644
--- a/js/ui/altTab.js
+++ b/js/ui/altTab.js
@@ -858,8 +858,6 @@ AppSwitcher.prototype = {
 
     _getPreferredHeight: function (actor, forWidth, alloc) {
         let j = 0;
-        let height = 0;
-
         while(this._items.length > 1 && this._items[j].style_class != 'item-box') {
                 j++;
         }
@@ -870,11 +868,17 @@ AppSwitcher.prototype = {
         if (this._separator)
            totalSpacing += this._separator.width + this._list.spacing;
 
+        // We just assume the whole screen here due to weirdness happing with the passed width
+        let focus = global.get_focus_monitor();
+        let parentPadding = this.actor.get_parent().get_theme_node().get_horizontal_padding();
+        let availWidth = focus.width - parentPadding - this.actor.get_theme_node().get_horizontal_padding();
+        let height = 0;
+
         for(let i =  0; i < iconSizes.length; i++) {
                 this._iconSize = iconSizes[i];
                 height = iconSizes[i] + iconSpacing;
                 let w = height * this._items.length + totalSpacing;
-                if (w <= forWidth)
+                if (w <= availWidth)
                         break;
         }
 



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