From f97d15ee12fbe5501dd02c7d1a6259a039aedac2 Mon Sep 17 00:00:00 2001 From: Danny Lin Date: Thu, 6 Jun 2024 23:19:39 -0700 Subject: [PATCH] HACK: add focus-follows-mouse --- macos/Sources/Ghostty/SurfaceView_AppKit.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/macos/Sources/Ghostty/SurfaceView_AppKit.swift b/macos/Sources/Ghostty/SurfaceView_AppKit.swift index 255248c61..2c8a3165d 100644 --- a/macos/Sources/Ghostty/SurfaceView_AppKit.swift +++ b/macos/Sources/Ghostty/SurfaceView_AppKit.swift @@ -514,6 +514,9 @@ extension Ghostty { let pos = self.convert(event.locationInWindow, from: nil) ghostty_surface_mouse_pos(surface, pos.x, frame.height - pos.y) + if !self.focused { + Ghostty.moveFocus(to: self) + } } override func mouseDragged(with event: NSEvent) {