Skip to content

mac: fullscreen around the notch (DM_FULLSCREEN=2) - #2979

Open
oxyp1e wants to merge 1 commit into
seedds:mainfrom
oxyp1e:pr/mac-fullscreen-notch
Open

oxyp1e wants to merge 1 commit into
seedds:mainfrom
oxyp1e:pr/mac-fullscreen-notch

Conversation

@oxyp1e

@oxyp1e oxyp1e commented Nov 18, 2026 •

Copy link
Copy Markdown

What and why

On a MacBook with a notch, native full screen keeps the picture below the menu bar (3024x1898 on a 14" MacBook Pro). The strips beside the camera housing stay black, and the menu bar drops into them when the pointer reaches the top. Native full screen can't be moved under the notch through any public API: the system places full-screen content in the safe area.

This adds a third Display mode, Fullscreen around the notch (DM_FULLSCREEN=2). On a screen with a top safe-area inset, full screen becomes a borderless window over the screen's whole frame (3024x1964). On a screen without a notch it is the same as DM_FULLSCREEN=1. Window and Fullscreen are unchanged, and Window is still the default.

How it works (front_mac.m):

  • DmGameWindow can be key and main while borderless. Its constrainFrameRect:toScreen: leaves the frame alone while the panel is up, so AppKit doesn't push it below the menu bar.
  • Level NSMainMenuWindowLevel + 1, presentation options HideDock | HideMenuBar: no Dock, and no menu bar on hover.
  • The window's toggleFullScreen: picks the panel or native full screen, so ⌃⌘F, the green button, the startup request and the GPU-lost path all follow the setting. win_full() replaces the full-screen style checks, so the 120 Hz → 60 Hz screen match also applies in the panel.
  • When another app is active, the window drops to its own level and the options are cleared; activation restores both. While a modal box is up (software keyboard, user choice, a Cheats question) the panel takes the window's own level, so the box shows above it. The Cheats panel is raised above the game.
  • Screen changes refit the panel, or leave it for a window when its screen has no notch (clamshell on an external display).
  • pack_app.py writes NSPrefersDisplaySafeAreaCompatibilityMode = false, so macOS never letterboxes the whole screen below the camera housing instead.

Picture shape. The present fits the game's picture into the drawable, as it does for any window. Alone, this PR shows a 16:9 game fitted in the 3024x1964 panel with bars at the sides, and the strip beside the notch is part of the drawable. With #2978 (Auto aspect for Ocarina of Time), the camera takes the panel's 1.54 and the picture fills it. The two PRs are independent, both off main, and touch neighbouring lines in front_mac.m. If both land, panel_enter and panel_leave need the two Auto-aspect calls that the native DidEnter / WillExit observers make (g_aspect_full = 1/0; aspect_auto();). I can rebase whichever goes in second.

Technique and sources

This is the "custom full-screen experience" Apple documents for notched screens, and the same window SDL3 and GLFW build for their exclusive full screen:

Trade-offs (the first two are in docs/settings.md): the panel has no Space of its own and stays on the current desktop; the camera housing hides the picture's top centre; Apple's HIG prefers the system full screen.

Checked

  • Tests, on this branch (GAME=0400486024DEC000, Xcode 27.2):
    • make -C dm/host dmhost: links. The only front_mac.m warning (activity set but not used) is also on main.
    • test_launcher_settings (the new option), test_nsp_mac_app (the Info.plist key), test_settings, test_docs: OK. The whole dm/tools/tests: 1759 tests. The only failures are in test_shader_toolchain_cache (NameError: dmsh_rewrite), and they fail the same way on main.
    • env_switches.py --check: OK.
    • Not run: lint_c.py tidy (only LLVM 22 here, CI pins 23), lint_python.py (ruff and pyright not installed), GPU tests (the present is untouched).
  • Games run, by me on the Mac:
    • A standalone AppKit prototype of exactly this window, then Ocarina of Time 0400486024DEC000 v131072 on a local branch with this change and game: Ocarina of Time's camera takes the full screen's aspect #2978 on top. Both filled 3024x1964 at about 120 fps, with no menu bar on hover.
    • This branch alone was not run: there the picture is 16:9 with side bars, which is the present's ordinary fit.
  • Devices and OS: Apple M5 MacBook Pro (14", macOS 27).
  • Not checked: the green button and fn+F entering the panel (assumed to reach DmGameWindow's toggleFullScreen:), ⌃⌘F out of the panel and back while playing, the modal-box level bracket, other MacBooks with a notch, M1 and M2, iOS (not affected), Game Mode and direct-to-display for a borderless window (nxnative apps ship with Game Mode off), and clamshell or docking with the panel up.
  • regress.py: not run. The change is the Mac window only, behind DM_FULLSCREEN=2: with 0 or 1, toggleFullScreen: calls super and win_full() is the old style check.

Front ends

Front-ends: new: DM_FULLSCREEN=2 needs NSPrefersDisplaySafeAreaCompatibilityMode false in the app's Info.plist (pack_app.py writes it); an app packed another way needs the key too.

Docs

  • No game files, keys or data extracted from a game in the change or the attachments

docs/settings.md (Display mode, the env table), docs/env_switches.tsv (DM_FULLSCREEN), docs/development.md (the Info.plist line).

🤖 Generated with Claude Code

Native full screen keeps a notched MacBook's picture below the menu bar
(3024x1898 on a 14" MacBook Pro), and the strips beside the camera housing
stay black. With DM_FULLSCREEN=2, full screen on a screen with a top
safe-area inset is instead a borderless window over the screen's whole
frame (3024x1964): the custom full screen Apple documents with
NSScreen.safeAreaInsets and auxiliaryTopLeftArea, built as SDL3 and GLFW
build theirs. DmGameWindow is key and main while borderless, and its
constrainFrameRect:toScreen: leaves the frame alone while the panel is up;
level NSMainMenuWindowLevel+1, HideDock|HideMenuBar (0xa, so no menu bar on
hover). A screen without a notch gets native full screen, exactly as
DM_FULLSCREEN=1. The present fits the game's 16:9 picture into the panel
as into any drawable, with bars at the sides; a game that takes the
screen's shape fills it.

DmGameWindow's toggleFullScreen: picks the panel or native full screen, so
⌃⌘F, the green button, the startup request and the GPU-lost path all
follow the setting. win_full() replaces the full-screen style checks
(screen_match_apply, so the 120 Hz screen match still applies; startup).
Screen changes refit the panel, or leave it when its screen has no notch
(a Studio Display in clamshell). While another app is active the window
drops to its own level and the presentation options are cleared;
activation puts both back. While a modal box is up (the software
keyboard, the user choice, a Cheats question) the panel takes the
window's own level, so the box shows above it; the Cheats panel is raised
above the game window. One [notch] line on entering and on leaving.

pack_app.py writes NSPrefersDisplaySafeAreaCompatibilityMode false, so
macOS never letterboxes the screen below the camera housing instead.
Launcher: Display mode gets "Fullscreen around the notch". Docs:
env_switches.tsv, settings.md, development.md.

Checked: the OoT host builds with no new warnings; test_launcher_settings
and test_nsp_mac_app cover the new option and the Info.plist key. Played
on an M5 MacBook Pro, macOS 27: a prototype of this window, and Ocarina of
Time on a branch with PR seedds#2978's Auto aspect, filled 3024x1964 at about
120 fps, with no menu bar on hover. This branch alone (16:9 with side bars)
was not run. Not checked:
other Macs, the M1 and M2, Game Mode (off in nxnative apps anyway).

Front-ends: new: DM_FULLSCREEN=2 needs NSPrefersDisplaySafeAreaCompatibilityMode false in the app's Info.plist (pack_app.py writes it); an app packed another way needs the key too.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@github-actions github-actions Bot added host The Horizon host: SVCs, services, threads, memory (dm/host) packing Building an IPA or a Mac app: the NSP script, extraction, the shader split, the packers mac The Mac front end and app (dm/mac, front_mac.m) tools Tools and scripts (dm/tools, scripts) docs Documentation labels Nov 18, 2026
@mbicknese

Copy link
Copy Markdown

I tried this on my M1 Max MacBook with Ocarina of Time. It starts with a full white screen (including next to notch), but once in the game it's letterboxed in menu, cutscenes and gameplay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation host The Horizon host: SVCs, services, threads, memory (dm/host) mac The Mac front end and app (dm/mac, front_mac.m) packing Building an IPA or a Mac app: the NSP script, extraction, the shader split, the packers tools Tools and scripts (dm/tools, scripts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants