[gnome-shell] altTab: Only calculate iconSize once
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] altTab: Only calculate iconSize once
- Date: Tue, 25 Jan 2022 20:11:52 +0000 (UTC)
commit c8f3db31b896fea895c04b1745bb9cafa3ef2d6d
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.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2098>
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]