fix: keyboard selection now works with dragging + mouse hover

(closes #4711)
This commit is contained in:
lwouis committed 2025-08-27 19:50:33 +02:00
1 parent 1a4b53917d
commit be077f1a67
1 file changed
+13 -2
+13 -2
View File
@@ -45,17 +45,28 @@ class ThumbnailView: FlippedView {
override func isAccessibilityElement() -> Bool { true }
override func wantsPeriodicDraggingUpdates() -> Bool { false }
override func draggingUpdated(_ sender: NSDraggingInfo) -> NSDragOperation {
mouseMovedCallback()
setDraggingTimer()
return .link
}
override func draggingEntered(_ sender: NSDraggingInfo) -> NSDragOperation {
setDraggingTimer()
return .link
}
private func setDraggingTimer() {
dragAndDropTimer?.invalidate()
dragAndDropTimer = Timer.scheduledTimer(withTimeInterval: 2, repeats: false, block: { _ in
self.mouseUpCallback()
// the user can tab to focus the next thumbnail, while still dragging. We don't want to perform drag then
if Windows.focusedWindowIndex == Windows.hoveredWindowIndex {
self.mouseUpCallback()
}
})
dragAndDropTimer?.tolerance = 0.2
return .link
}
override func draggingExited(_ sender: NSDraggingInfo?) {