Fix fullscreen detection on notched displays (Sequoia/Tahoe)#31
Open
jeffscottmtl wants to merge 2 commits into
Open
Fix fullscreen detection on notched displays (Sequoia/Tahoe)#31jeffscottmtl wants to merge 2 commits into
jeffscottmtl wants to merge 2 commits into
Conversation
The previous getFullScreens() compared a window's CGWindowList bounds (top-left origin, CG global coords) directly against NSScreen.frame (bottom-left origin, AppKit coords) using equalTo, and assumed a fullscreen window's height equals screen.frame.height. On notched MacBooks running Sequoia/Tahoe, native fullscreen renders *below* the notch, so the window is ~safeAreaInsets.top shorter than screen.frame. The strict equality check always fails on these machines, which is why the logo never disappears in fullscreen even with "Always on Screen" toggled off (see lihaoyun6#29, lihaoyun6#30). Replace equalTo with isFullScreenWindow(), which: - converts NSScreen.frame to CG coordinates using the primary screen's height - accepts either the full screen rect or the screen-minus-notch rect - tolerates 2pt of sub-pixel rounding Closes lihaoyun6#29 Closes lihaoyun6#30 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 23, 2026
The previous getFullScreens() accepted a second "screen minus the top inset" rect (cgScreenBelowNotch) as a full-screen match, on the premise that notched Macs render native full screen below the notch. Live instrumentation on macOS 26 (Tahoe, notched, built-in + external display) disproved that premise: native full screen covers the ENTIRE display (origin.y == 0, full height), while a merely maximized window sits below the menu bar at origin.y == menuBarHeight. The below-notch rect is geometrically identical to a maximized window, so isFullScreenWindow() returned true for any maximized window. The logo was hidden whenever a maximized window was on screen, which is why it never came back after exiting full screen (you exit into a maximized window) until the app was restarted. Match only the full-screen rect, keeping the CGWindow<->NSScreen coordinate conversion and the 2pt tolerance (the genuinely useful parts of the prior fix, confirmed working for the external display via the Y origin flip). The top-edge difference (y==0 vs y==menuBarHeight) cleanly separates true full screen from maximized. Verified across a full enter/exit cycle on built-in and external displays: maximized leaves the logo visible, full screen hides it, and exiting restores it immediately with no restart. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
safeAreaInsets.topshorter thanNSScreen.frame. The strictwindowRect.equalTo(screen.frame)check ingetFullScreens()always fails on these machines, so the logo never hides in fullscreen even with "Always on Screen" toggled off.CGWindowListbounds (top-left origin, Y grows down) andNSScreen.frame(bottom-left origin, Y grows up). It only matched on the primary display because both happen to anchor at (0,0) there.equalTowith a newisFullScreenWindow(_:on:primaryHeight:)helper that converts to a common coordinate space, accepts either the full screen rect or the screen-minus-notch rect, and tolerates 2 pt of sub-pixel rounding. Non-notched displays are unaffected becausesafeAreaInsets.top == 0, socgScreenBelowNotch == cgScreenRect.Reproducing on my machine,
screen.framereported(0, 0, 1710, 1107)withsafeAreaInsets.top == 33, while the fullscreen Safari window'skCGWindowBoundscame back as~(0, 33, 1710, 1074)— i.e. exactly 33 pt shorter. The new check matches that variant.Closes #29
Closes #30
Test plan
ContentViewlogic)🤖 Generated with Claude Code