Skip to content

Add a Terminal option to use the full screen height when the menu bar is hidden - #1934

Merged
rxhanson merged 1 commit into
rxhanson:mainfrom
AkiyamaKunka:fix/ignore-hidden-menu-bar
Oct 25, 2026
Merged

rxhanson merged 1 commit into
rxhanson:mainfrom
AkiyamaKunka:fix/ignore-hidden-menu-bar

Conversation

@AkiyamaKunka

@AkiyamaKunka AkiyamaKunka commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1043

When only the frontmost app hides the menu bar (for example with LSUIPresentationMode in its Info.plist), macOS keeps reporting the menu bar's strip as reserved in NSScreen.visibleFrame, so Maximize and the other actions stop a menu bar's height short of the top of the screen (777 of 800 pt in the issue's log).

In #1043 you wrote: "if anyone wants to add in a Terminal command configured option to just use the whole screen, I'd merge it in." This is that option.

defaults write com.knollsoft.Rectangle ignoreMenuBar -bool true

What it does

  • Opt-in, Terminal-only, off by default. No UI, no README change.
  • adjustedVisibleFrame applies a small pure helper (MenuBarUtil.frameIgnoringMenuBar) right after the Dock correction and before Stage Manager, Todo and the screen edge gaps, so every action, snap area and multi-window path picks it up the same way.
  • The frame is extended only upward and never shrunk, stops below the notch on displays that have one, keeps Dock insets and the frame's origin on secondary displays, and is applied per screen before the union in combined display mode.
  • screenEdgeGapTop and screenEdgeGapTopNotch still apply on top of the extended frame.
  • The key is exported and imported with the rest of the config (Defaults.array).
  • Documented in TerminalCommands.md, including the restart note and the revert.

Why a dedicated key

A negative screenEdgeGapTop already grows the frame upward, but by a fixed number of points rather than each display's real menu bar height, and the screenEdgeGapTopNotch branch bypasses it on notched displays. The new key reads the right value per display.

Notes

  • While the menu bar is visible, macOS keeps windows below it, so the docs say to enable this only when the menu bar is hidden. When the menu bar is hidden system-wide in System Settings, macOS already reports the full height and the option changes nothing.
  • No change to WindowManager.swift or its extensions.
  • Happy to rename the key (for example useFullScreenHeight) if you prefer something else.

Tests

  • MenuBarUtilTests: the pure helper (plain display, notch cap, already-full frames, never shrinks, Dock insets, secondary display origins, CGRect.null).
  • IgnoreMenuBarTests: the top edge of adjustedVisibleFrame with the option unset/on/off, on a notched screen, with screenEdgeGapTop and screenEdgeGapTopNotch composing on top, -bool true read from UserDefaults, and a config export/import round trip.
  • DefaultsExportTests.testIgnoreMenuBarInExportArray.
  • Full suite: 619 tests, 0 failures (Xcode 27, macOS 27.0.1).

When only the frontmost app hides the menu bar, macOS keeps reporting
its strip as reserved in NSScreen.visibleFrame, so windows stop a menu
bar's height short of the top of the screen.

`defaults write com.knollsoft.Rectangle ignoreMenuBar -bool true`
extends the visible frame to the top edge, staying below a notch, right
after the Dock correction and before the Stage Manager, Todo and screen
edge gap adjustments. Opt-in and Terminal-only; documented in
TerminalCommands.md and carried by config export/import.

Fixes rxhanson#1043

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@AkiyamaKunka
AkiyamaKunka marked this pull request as draft October 19, 2026 16:10
@AkiyamaKunka
AkiyamaKunka marked this pull request as ready for review October 20, 2026 19:57
@rxhanson
rxhanson merged commit ef6ad74 into rxhanson:main Oct 25, 2026
1 check passed
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.

Fullscreen with hidden menu bar still thinks that the menu bar exists

2 participants