diff --git a/js/ui/altTab.js b/js/ui/altTab.js index 12b784939..35d991e20 100644 --- a/js/ui/altTab.js +++ b/js/ui/altTab.js @@ -775,7 +775,9 @@ class AppSwitcher extends SwitcherPopup.SwitcherList { // We override SwitcherList's _onItemEnter method to delay // activation when the thumbnail list is open - _onItemEnter(index) { + _onItemEnter(item) { + const index = this._items.indexOf(item); + if (this._mouseTimeOutId != 0) GLib.source_remove(this._mouseTimeOutId); if (this._altTabPopup.thumbnailsVisible) { diff --git a/js/ui/switcherPopup.js b/js/ui/switcherPopup.js index 46a4b158a..f7ee2e769 100644 --- a/js/ui/switcherPopup.js +++ b/js/ui/switcherPopup.js @@ -427,9 +427,8 @@ var SwitcherList = GObject.registerClass({ bbox.set_child(item); this._list.add_actor(bbox); - let n = this._items.length; - bbox.connect('clicked', () => this._onItemClicked(n)); - bbox.connect('motion-event', () => this._onItemEnter(n)); + bbox.connect('clicked', () => this._onItemClicked(bbox)); + bbox.connect('motion-event', () => this._onItemEnter(bbox)); bbox.label_actor = label; @@ -452,14 +451,14 @@ var SwitcherList = GObject.registerClass({ this._items[index].remove_accessible_state(state); } - _onItemClicked(index) { - this._itemActivated(index); + _onItemClicked(item) { + this._itemActivated(this._items.indexOf(item)); } - _onItemEnter(index) { + _onItemEnter(item) { // Avoid reentrancy - if (index !== this._highlighted) - this._itemEntered(index); + if (item !== this._items[this._highlighted]) + this._itemEntered(this._items.indexOf(item)); return Clutter.EVENT_PROPAGATE; }