mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-19 18:26:13 +03:00
Merge pull request #1322 from mitchellh/macos-mouse-follow
macos: allow first click when non-focused to shift focus
This commit is contained in:
@ -691,6 +691,14 @@ extension Ghostty {
|
|||||||
ghostty_surface_refresh(surface);
|
ghostty_surface_refresh(surface);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override func acceptsFirstMouse(for event: NSEvent?) -> Bool {
|
||||||
|
// "Override this method in a subclass to allow instances to respond to
|
||||||
|
// click-through. This allows the user to click on a view in an inactive
|
||||||
|
// window, activating the view with one click, instead of clicking first
|
||||||
|
// to make the window active and then clicking the view."
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
override func mouseDown(with event: NSEvent) {
|
override func mouseDown(with event: NSEvent) {
|
||||||
guard let surface = self.surface else { return }
|
guard let surface = self.surface else { return }
|
||||||
let mods = Ghostty.ghosttyMods(event.modifierFlags)
|
let mods = Ghostty.ghosttyMods(event.modifierFlags)
|
||||||
|
Reference in New Issue
Block a user