From 5939b8c1be511020b5ec46c73509dc9d29a964a1 Mon Sep 17 00:00:00 2001 From: Lukas <134181853+bo2themax@users.noreply.github.com> Date: Fri, 17 Apr 2026 20:05:18 +0200 Subject: [PATCH] macOS: fix 12266 by using the correct coordinates for the hitTest Regression of #11872 --- macos/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/macos/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift b/macos/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift index 5b52a4961..0d27e13f9 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 }