From d12f07ceda1e8afabe5cc0ee9bc4529ad013b12c Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 21 Sep 2023 09:30:42 -0700 Subject: [PATCH] macos: mouse tracking area should always send Without this, non-first-responder views would not receive mouse entered/exit events. This would break some of our mouse hiding state. See comments for more info. --- macos/Sources/Ghostty/SurfaceView.swift | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/macos/Sources/Ghostty/SurfaceView.swift b/macos/Sources/Ghostty/SurfaceView.swift index 913b1cfb1..ec20c21d8 100644 --- a/macos/Sources/Ghostty/SurfaceView.swift +++ b/macos/Sources/Ghostty/SurfaceView.swift @@ -419,12 +419,13 @@ extension Ghostty { options: [ .mouseEnteredAndExited, .mouseMoved, + + // Only send mouse events that happen in our visible (not obscured) rect .inVisibleRect, - // It is possible this is incorrect when we have splits. This will make - // mouse events only happen while the terminal is focused. Is that what - // we want? - .activeWhenFirstResponder, + // We want active always because we want to still send mouse reports + // even if we're not focused or key. + .activeAlways, ], owner: self, userInfo: nil))