[gnome-shell/gnome-40] altTab: Only calculate iconSize once



commit 914dc54fe610e66abc677f7ba4b76f4b9f3e59be
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Thu Apr 26 01:36:41 2018 +0200

    altTab: Only calculate iconSize once
    
    Right now, _setIconSize() calculates the icon size everytime the
    preferred height of AppSwitcher is calculated, which happens quite
    often.
    
    Reduce the perfomance impact by only calculating the icon size once.
    This has the added benefit of preventing unexpected changes to the icon
    sizes while the switcher is open.
    
    (cherry picked from commit c8f3db31b896fea895c04b1745bb9cafa3ef2d6d)
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2181>

 js/ui/altTab.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/altTab.js b/js/ui/altTab.js
index e7886e4f1e..78450ac789 100644
--- a/js/ui/altTab.js
+++ b/js/ui/altTab.js
@@ -765,7 +765,9 @@ class AppSwitcher extends SwitcherPopup.SwitcherList {
     }
 
     vfunc_get_preferred_height(forWidth) {
-        this._setIconSize();
+        if (!this._iconSize)
+            this._setIconSize();
+
         return super.vfunc_get_preferred_height(forWidth);
     }
 


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