Skip to content

Skip show-on-click when an overlay covers the menu bar#933

Open
AlexandrosAlexiou wants to merge 1 commit into
jordanbaird:mainfrom
AlexandrosAlexiou:fix/skip-overlay-windows-above-menu-bar
Open

Skip show-on-click when an overlay covers the menu bar#933
AlexandrosAlexiou wants to merge 1 commit into
jordanbaird:mainfrom
AlexandrosAlexiou:fix/skip-overlay-windows-above-menu-bar

Conversation

@AlexandrosAlexiou
Copy link
Copy Markdown

isMouseInsideEmptyMenuBarSpace already excludes the hardware notch, but it doesn't account for third‑party windows whose level sits above the menu bar (e.g. notch‑extension apps like boring.notch, which uses level = .mainMenu + 3). When the user clicks one of those overlays' UI elements, Ice's NSEvent global monitor fires (the click was delivered to "another app"), the overlap with the menu‑bar Y range satisfies isMouseInsideMenuBar, none of the existing exclusions match and Show on Click toggles a hidden section even though the user never clicked the menu bar.

This adds a generic gate that asks the WindowServer for windows occluding the click point above menu‑bar level (and below the cursor), excluding Ice's own windows. If one is found, the click is treated as not inside an empty menu bar space.

Repro

  1. Install boring.notch (or any app with a window at NSWindow.Level.mainMenu + N).
  2. Enable Settings -> General -> Show on Click in Ice.
  3. Hide a section so it's available to toggle.
  4. Click any control inside the boring.notch UI (e.g. the shelf tab).
  5. Before this change: the hidden section toggles. After: it doesn't.

isMouseInsideEmptyMenuBarSpace already excludes the hardware notch but
not third-party overlay windows whose level is above the menu bar,
causing show-on-click to toggle when the user clicks the overlay's UI.
Add an isMouseInsideOverlayAboveMenuBar gate that checks the on-screen
window list for any non-Ice window with a layer above the menu bar at
the click point.
emindeniz99 pushed a commit to emindeniz99/Ice that referenced this pull request Apr 30, 2026
* .github/workflows/build.yml runs on every push/PR.

  - swift-parse: Linux job. Installs Swift 6.0.3 and runs
    `swiftc -parse -enable-bare-slash-regex` on every .swift file in
    Ice / MenuBarItemService / Shared. Catches raw syntax errors
    cheaply on free runners before we burn macOS minutes.

  - build: matrix over macos-26 (has the macOS 26 SDK and Xcode 26)
    and macos-15 (sanity check that we haven't quietly leaked a
    macOS 26-only API into an unguarded code path). Both build the
    Ice and MenuBarItemService schemes in Debug with code signing
    fully disabled, since we don't have Jordan's team identifier on
    CI runners. Logs uploaded as artifacts on every run, errors
    grepped out and surfaced in the job output.

* HIDEventManager.isMouseInsideEmptyMenuBarSpace now also rejects
  "an overlay whose level is above the menu bar at the cursor". This
  is AlexandrosAlexiou's PR jordanbaird#933, ported to the current codebase
  (the file was renamed EventManager -> HIDEventManager and the
  helper namespace MouseCursor -> MouseHelpers in the macos-26
  branch refactor; the WindowInfo helper for getting on-screen
  windows is also named differently here). Without it,
  show-on-click toggles a section when the click was meant for a
  third-party HUD/notification overlay drawn above the menu bar.
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