diff --git a/macos/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift b/macos/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift index 5b52a496152..0d27e13f9aa 100644 --- a/macos/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift +++ b/macos/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift @@ -617,7 +617,11 @@ extension Ghostty { window == event.window else { return event } // The clicked location in this window should be this view. - let location = convert(event.locationInWindow, from: nil) + guard + let location = window.contentView?.convert(event.locationInWindow, from: nil) + else { + return event + } // We should use window to perform hitTest here, // because there could be some other overlays on top, like search bar guard window.contentView?.hitTest(location) == self else { return event }