From c8f3db31b896fea895c04b1745bb9cafa3ef2d6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Thu, 26 Apr 2018 01:36:41 +0200 Subject: [PATCH] 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. Part-of: --- 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 e7886e4f1..78450ac78 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); }