[gnome-shell] altTab: Use this._highlighted instead of this._curApp in AppSwitcher
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] altTab: Use this._highlighted instead of this._curApp in AppSwitcher
- Date: Wed, 12 Jan 2022 12:29:56 +0000 (UTC)
commit 7ae694990b871dbb3407ac974220ff182c56f386
Author: Jonas Dreßler <verdre v0yd nl>
Date: Mon Apr 30 01:06:35 2018 +0200
altTab: Use this._highlighted instead of this._curApp in AppSwitcher
Thanks to the parent class (SwitcherPopup), we already have a property
for the currently highlighted item, let's use it.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2097>
js/ui/altTab.js | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
---
diff --git a/js/ui/altTab.js b/js/ui/altTab.js
index dacd9bec67..c03c680c33 100644
--- a/js/ui/altTab.js
+++ b/js/ui/altTab.js
@@ -706,7 +706,6 @@ class AppSwitcher extends SwitcherPopup.SwitcherList {
this._addIcon(appIcon);
}
- this._curApp = -1;
this._altTabPopup = altTabPopup;
this._mouseTimeOutId = 0;
@@ -829,21 +828,20 @@ class AppSwitcher extends SwitcherPopup.SwitcherList {
// show a dim arrow, but show a bright arrow when they are
// highlighted.
highlight(n, justOutline) {
- if (this.icons[this._curApp]) {
- if (this.icons[this._curApp].cachedWindows.length == 1)
- this._arrows[this._curApp].hide();
+ if (this.icons[this._highlighted]) {
+ if (this.icons[this._highlighted].cachedWindows.length === 1)
+ this._arrows[this._highlighted].hide();
else
- this._arrows[this._curApp].remove_style_pseudo_class('highlighted');
+ this._arrows[this._highlighted].remove_style_pseudo_class('highlighted');
}
super.highlight(n, justOutline);
- this._curApp = n;
- if (this._curApp != -1) {
- if (justOutline && this.icons[this._curApp].cachedWindows.length == 1)
- this._arrows[this._curApp].show();
+ if (this._highlighted !== -1) {
+ if (justOutline && this.icons[this._highlighted].cachedWindows.length === 1)
+ this._arrows[this._highlighted].show();
else
- this._arrows[this._curApp].add_style_pseudo_class('highlighted');
+ this._arrows[this._highlighted].add_style_pseudo_class('highlighted');
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]