Skip to content

Count the top row of pixels as part of the menu bar - #46

Open
jorgenbruntveit wants to merge 1 commit into
nilbuild:mainfrom
jorgenbruntveit:fix-menu-bar-edge
Open

jorgenbruntveit wants to merge 1 commit into
nilbuild:mainfrom
jorgenbruntveit:fix-menu-bar-edge

Conversation

@jorgenbruntveit

Copy link
Copy Markdown

With the mouse pushed against the top of the screen, the menu bar check fails on the very top row of pixels. menuBarRect spans maxY - height ..< maxY, and CGRect.contains leaves out the maxY edge, but the mouse reaches y == maxY on that row.

What you see

  • With Show the cursor, the hand vanishes as it enters the menu bar and comes back on the top row, then vanishes again one row lower. From the log on a 1440-point-tall screen:

    real cursor (menu bar) at 2417,1410
    pointer back at 2417,1440
    real cursor (menu bar) at 2416,1439
    
  • The same rect decides which clicks pass through to the menu bar, so a click on the top row while presenting becomes a tap instead of opening the menu. That row is the one people often throw the mouse at.

Fix

menuBarRect is one point taller, so it reaches past the top of the screen and the top row counts as inside the menu bar. Nothing else changes.

Testing

Built with swift build -c release on macOS 27.3 and used locally.

🤖 Generated with Claude Code

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 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant