mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
macos: notify core of mouse exit
This commit is contained in:
@ -354,6 +354,7 @@ extension Ghostty {
|
|||||||
addTrackingArea(NSTrackingArea(
|
addTrackingArea(NSTrackingArea(
|
||||||
rect: frame,
|
rect: frame,
|
||||||
options: [
|
options: [
|
||||||
|
.mouseEnteredAndExited,
|
||||||
.mouseMoved,
|
.mouseMoved,
|
||||||
|
|
||||||
// Only send mouse events that happen in our visible (not obscured) rect
|
// Only send mouse events that happen in our visible (not obscured) rect
|
||||||
@ -486,6 +487,14 @@ extension Ghostty {
|
|||||||
super.rightMouseUp(with: event)
|
super.rightMouseUp(with: event)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override func mouseExited(with event: NSEvent) {
|
||||||
|
guard let surface = self.surface else { return }
|
||||||
|
|
||||||
|
// Negative values indicate cursor has left the viewport
|
||||||
|
let mods = Ghostty.ghosttyMods(event.modifierFlags)
|
||||||
|
ghostty_surface_mouse_pos(surface, -1, -1, mods)
|
||||||
|
}
|
||||||
|
|
||||||
override func mouseMoved(with event: NSEvent) {
|
override func mouseMoved(with event: NSEvent) {
|
||||||
guard let surface = self.surface else { return }
|
guard let surface = self.surface else { return }
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user