From 5c8f3a65f79a2e5a10c388ce3fc3c61441e7084e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Wed, 25 Apr 2018 22:14:57 +0200 Subject: [PATCH] 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 d1322106e..d026453ca 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; }