diff --git a/Folders/Views/InteractiveCollectionView.swift b/Folders/Views/InteractiveCollectionView.swift index 8b83523..d8ce0dc 100644 --- a/Folders/Views/InteractiveCollectionView.swift +++ b/Folders/Views/InteractiveCollectionView.swift @@ -78,6 +78,11 @@ class InteractiveCollectionView: NSCollectionView { override func mouseDown(with event: NSEvent) { + // Ignore events if we're not the key window. + guard (self.window?.isKeyWindow ?? false) else { + return + } + window?.makeFirstResponder(self) let position = self.convert(event.locationInWindow, from: nil) @@ -170,6 +175,12 @@ class InteractiveCollectionView: NSCollectionView { } override func mouseUp(with event: NSEvent) { + + // Ignore events if we're not the key window. + guard (self.window?.isKeyWindow ?? false) else { + return + } + super.mouseUp(with: event) // Handle double-click.