Skip to content

A fast file manager for Windows and macOS that never freezes: tabs, dual panes, archives as folders, Quick Look-style previews. A File Explorer and Finder alternative written in Rust.

Handle empty viewport clicks in macOS Details view

sunzhaozheng6810fbbccf04
diff --git a/macos/Sources/RustyFiles/FileList.swift b/macos/Sources/RustyFiles/FileList.swift
index 4e1571e2..47818ddd 100644
--- a/macos/Sources/RustyFiles/FileList.swift
+++ b/macos/Sources/RustyFiles/FileList.swift
@@ -579,6 +579,10 @@ final class FileTableView: NSTableView, NSServicesMenuRequestor {
if selectedRowIndexes.contains(r) { deselectRow(r) } else { selectRowIndexes([r], byExtendingSelection: true) }
return
}
+ if r < 0, event.clickCount == 2, !event.modifierFlags.contains(.control) {
+ list?.emptySpaceDoubleClicked()
+ return
+ }
if r < 0, event.clickCount == 1, allowsMultipleSelection,
!event.modifierFlags.contains(.control) {
let initial = selectedRowIndexes
diff --git a/macos/Sources/RustyFiles/Swipe.swift b/macos/Sources/RustyFiles/Swipe.swift
index e8d58625..255ea27e 100644
--- a/macos/Sources/RustyFiles/Swipe.swift
+++ b/macos/Sources/RustyFiles/Swipe.swift
@@ -64,13 +64,13 @@ final class SwipeScrollView: NSScrollView {
override func hitTest(_ point: NSPoint) -> NSView? {
let hit = super.hitTest(point)
- // Insets and unused space beyond the collection's frame belong to the clip view.
- // Route only a left press there to the collection's background selection handler.
+ // Blank viewport space outside the document still belongs to the file pane.
+ // Leave scrollers, controls, and ordinary item clicks on their native paths.
if hit === contentView || hit === self,
contentView.frame.contains(convert(point, from: superview)),
NSApp.currentEvent?.type == .leftMouseDown,
- let tiles = documentView as? TileCollectionView {
- return tiles
+ let documentView, documentView is FileTableView || documentView is TileCollectionView {
+ return documentView
}
return hit
}