diff --git a/mac/Sources/Byre/MarkdownView.swift b/mac/Sources/Byre/MarkdownView.swift index 8941654..5ce5fa6 100644 --- a/mac/Sources/Byre/MarkdownView.swift +++ b/mac/Sources/Byre/MarkdownView.swift @@ -476,6 +476,25 @@ private final class FlowTextView: NSTextView { return super.resignFirstResponder() } + override func cursorUpdate(with event: NSEvent) { + guard frontmost(event) else { + NSCursor.arrow.set() + return + } + super.cursorUpdate(with: event) + } + + override func mouseMoved(with event: NSEvent) { + guard frontmost(event) else { + return + } + super.mouseMoved(with: event) + } + + private func frontmost(_ event: NSEvent) -> Bool { + unsafe window?.contentView?.hitTest(event.locationInWindow)?.isDescendant(of: self) == true + } + override func mouseDown(with event: NSEvent) { let onLink = link(at: convert(event.locationInWindow, from: nil)) super.mouseDown(with: event)