From d3cabc1c0594b7691e25d216351e2ba203ec69db Mon Sep 17 00:00:00 2001 From: Louis Pontoise Date: Tue, 24 May 2022 23:48:45 +0900 Subject: [PATCH] fix: better mouse hover behavior (#1557) --- src/ui/main-window/ThumbnailView.swift | 4 +--- src/ui/main-window/ThumbnailsView.swift | 4 ---- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/ui/main-window/ThumbnailView.swift b/src/ui/main-window/ThumbnailView.swift index 1d7c473b..9279f1ce 100644 --- a/src/ui/main-window/ThumbnailView.swift +++ b/src/ui/main-window/ThumbnailView.swift @@ -23,7 +23,6 @@ class ThumbnailView: NSStackView { var shouldShowWindowControls = false var isShowingWindowControls = false var windowlessIcon = FontIcon(.newWindow) - var mouseIsHovering = false // for VoiceOver cursor override var canBecomeKeyView: Bool { true } @@ -90,7 +89,7 @@ class ThumbnailView: NSStackView { highlightOrNot() } } - showOrHideWindowControls(isHighlighted && mouseIsHovering) + showOrHideWindowControls(false) } func highlightOrNot() { @@ -171,7 +170,6 @@ class ThumbnailView: NSStackView { } self.mouseUpCallback = { () -> Void in App.app.focusSelectedWindow(element) } self.mouseMovedCallback = { () -> Void in Windows.updateFocusedWindowIndex(index) } - showOrHideWindowControls(false) // force a display to avoid flickering; see https://github.com/lwouis/alt-tab-macos/issues/197 // quirk: display() should be called last as it resets thumbnail.frame.size somehow if labelChanged { diff --git a/src/ui/main-window/ThumbnailsView.swift b/src/ui/main-window/ThumbnailsView.swift index 6e894552..3730f674 100644 --- a/src/ui/main-window/ThumbnailsView.swift +++ b/src/ui/main-window/ThumbnailsView.swift @@ -220,19 +220,15 @@ class ScrollView: NSScrollView { if let target = target, target is ThumbnailView { if previousTarget != target { previousTarget?.showOrHideWindowControls(false) - previousTarget?.mouseIsHovering = false previousTarget = target as? ThumbnailView } let target = target as! ThumbnailView target.mouseMoved() - target.mouseIsHovering = true } else { previousTarget?.showOrHideWindowControls(false) - previousTarget?.mouseIsHovering = false } } else { previousTarget?.showOrHideWindowControls(false) - previousTarget?.mouseIsHovering = false } }