From 68359799e189a840f5e66c61a7c0d239dff698cf Mon Sep 17 00:00:00 2001 From: Jorgen Bruntveit Date: Wed, 18 Nov 2026 12:24:11 +0100 Subject: [PATCH] Count the top row of pixels as part of the menu bar CGRect.contains leaves out the rect's maxY edge, so with the mouse pushed against the top of the screen the menu bar check failed: the hand vanished as it entered the menu bar and came back at the very top. The menu bar rect now reaches one point past the top. Co-Authored-By: Claude Opus 5.5 --- Sources/TinyHand/OverlayController.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/TinyHand/OverlayController.swift b/Sources/TinyHand/OverlayController.swift index b0eae63..4be0f7f 100644 --- a/Sources/TinyHand/OverlayController.swift +++ b/Sources/TinyHand/OverlayController.swift @@ -550,7 +550,8 @@ final class OverlayController { private static func menuBarRect(_ screen: NSScreen) -> CGRect { let height = max(24, screen.frame.maxY - screen.visibleFrame.maxY) - return CGRect(x: screen.frame.minX, y: screen.frame.maxY - height, width: screen.frame.width, height: height) + // One point taller than the bar, so the top row of pixels (y == maxY) counts as inside it too. + return CGRect(x: screen.frame.minX, y: screen.frame.maxY - height, width: screen.frame.width, height: height + 1) } private static func openMenus() -> [CGRect] {