[gnome-shell] switcherPopup: Use this._highlighted to check for reentrancy



commit 5c8f3a65f79a2e5a10c388ce3fc3c61441e7084e
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Wed Apr 25 22:14:57 2018 +0200

    switcherPopup: Use this._highlighted to check for reentrancy
    
    Since this._highlighted is always set to the currently highlighted
    index, there's no need to save the index to a separate variable. This
    obviously depends on getting the new item highlighted as a result of the
    item-entered event.
    
    This fixes bugs in situations where the highlighted element changes
    after an event that is not calling _onItemEnter, for example after
    scrolling or pressing a key. In those cases the _currentItemEntered
    variable wouldn't be updated and the old item couldn't be entered
    anymore without entering another one before.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/167

 js/ui/switcherPopup.js | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/switcherPopup.js b/js/ui/switcherPopup.js
index d1322106e3..d026453ca3 100644
--- a/js/ui/switcherPopup.js
+++ b/js/ui/switcherPopup.js
@@ -440,10 +440,9 @@ var SwitcherList = GObject.registerClass({
 
     _onItemEnter(index) {
         // Avoid reentrancy
-        if (index != this._currentItemEntered) {
-            this._currentItemEntered = index;
+        if (index !== this._highlighted)
             this._itemEntered(index);
-        }
+
         return Clutter.EVENT_PROPAGATE;
     }
 


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