Repository navigation
Conversation
…on the active Space, repeat a refused request once A game opened from an app that is in fullscreen stayed a window. The request is now made when the app is active and the window is on the active Space, and repeated once when AppKit reports a refusal.
… fullscreen once it is on the active Space Forwarded patch for dm/host/front_mac.m and its reference entry.
… fullscreen once it is on the active Space Forwarded patch for dm/host/front_mac.m and its reference entry.
|
Confirming from the reporter's side (NX2Apple): the failure is real, and the fix works. The failure reproduces. A real game build (Hades II) started from the launcher's console mode (the launcher itself fullscreen) came up windowed in 4/4 launches, with The fix works. With this PR's code carried in the fork and the same game started the same way, the deferred request was taken the first time: the drawables go One note from testing an alternative first: a bounded interval retry (0.5 s apart, stopping at |
… fullscreen once it is on the active Space Forwarded patch for dm/host/front_mac.m and its reference entry.
…ive Space Console mode launches the game while the launcher's own full screen Space is front, and the window then comes up in the middle of that Space switch: the startup toggleFullScreen is refused or rolled back and the game stays windowed although DM_FULLSCREEN=1 reached it. Carries seedds/nxnative#665 by v0lumehi: the request waits for the app to be active with its window on the active Space, and a refused one is repeated once through the window delegate. Validated on a real game build started from a fullscreen parent app, which the upstream PR had only built: the deferred request is taken the first time and the window enters full screen with no rolled back attempt and holds.
…ive Space Console mode launches the game while the launcher's own full screen Space is front, and the window then comes up in the middle of that Space switch: the startup toggleFullScreen is refused or rolled back and the game stays windowed although DM_FULLSCREEN=1 reached it. Carries seedds/nxnative#665 by v0lumehi: the request waits for the app to be active with its window on the active Space, and a refused one is repeated once through the window delegate. Validated on a real game build started from a fullscreen parent app, which the upstream PR had only built: the deferred request is taken the first time and the window enters full screen with no rolled back attempt and holds.
… fullscreen once it is on the active Space Forwarded patch for dm/host/front_mac.m and its reference entry.
Carry seedds/nxnative#665: fullscreen for a game opened from a fullscreen app
A game launched from another fullscreen app could request fullscreen before its window reached the active Space, causing AppKit to roll the entry back. Wait for app activation and window Space readiness before making the request, and allow one repeat when AppKit reports a refused startup attempt. Track the outstanding startup request and retire its failure handler after successful entry or player takeover while waiting. A later refused manual entry can no longer restart startup handling. Keep native fullscreen and the existing screen refresh-rate matching behavior. The reporter reproduced the original failure on four of four Hades II launches and confirmed the readiness fix. The revised callbacks pass all 11 lifecycle harness cases; the original PR fails two. Mac host build, host unit tests, documentation tests and targeted LLVM 23 clang-tidy pass. Regression risk is low and confined to fullscreen startup, so no game regression runs were performed; the revised lifecycle still needs native launcher testing. Co-authored-by: v0lumehi <[email protected]>
|
Landed on main in 3d247f35, with v0lumehi credited as co-author for the fullscreen readiness fix. The landing also fixes the startup handler's lifecycle: refusal recovery applies only to an outstanding automatic startup request, and successful entry or player takeover while startup is waiting retires the handler. A later refused manual fullscreen request can no longer restart startup handling. All 11 lifecycle harness cases pass, along with the Mac host build, host tests, documentation tests, and targeted clang-tidy check. Closing as landed. Thanks for the fix and the reporter's verification. |
…off (Persona 5 Royal) A program's shader libraries are loaded in the background as soon as the game makes the program (nvn_mtl.m mtl_prog_prefetch, from nvnProgramSetShaders), whether or not a draw uses them. It had a switch, DM_NVN_PREFETCH=0, but no front end could offer it: dm/ios/Sources/player_env.h filters the DM_NVN_ prefix as a diagnostic, so it cannot be saved from Documents/env.txt either. On iOS a loaded library is a mapping the process keeps for good: NvShader holds the MTLFunction, the function holds the library, and the shader table keeps the shader by key. A game with a very large shader tree fills the process's mapping limit that way and is ended with vnode-limit. Persona 5 Royal is 24,826 pipelines, 88,792 metallib and 30,646 json (119,439 files, 1.3 GB) and was ended after 60-100 s in every configuration tried on an iPhone 17 Pro, while Breath of the Wild (4,829 pipelines) and Rhythm Heaven Groove (100 metallib) run for hours on the same device and build (LNPANDY/NX2Apple#665, seedds#666). Off, one run held 30 fps for 34 minutes: 61,200 presents, p50 33.34 ms, 1,773 MiB, 410,000 audio callbacks with no underrun, no crash; with it on the same build aborted in a prefetch worker at 5 min 33 s. - settings.tsv gains the row for every NVN game, in Performance, with the iOS default from the profile and the Mac default on (the shape DM_PSO_MTL4 has). - player_env.h carries the exception DM_NVN_ENC_THREAD already has, so a player build keeps the launcher's value. - game.py takes the profile key nvn_prefetch (on / off) and writes DM_GAME_NVN_PREFETCH, which settings.py resolves as the iOS default. - Persona 5 Royal's profile sets it off, so a player never has to find the row. - The test covers the row's graphics API, both platforms' defaults and the Mac. Off bounds nothing by itself: the mappings still grow, from what is drawn instead of what is in the program, and a long session still ends somewhere. The prefetch staying unbounded is seedds#665's subject.
) A game launched from another fullscreen app could request fullscreen before its window reached the active Space, causing AppKit to roll the entry back. Wait for app activation and window Space readiness before making the request, and allow one repeat when AppKit reports a refused startup attempt. Track the outstanding startup request and retire its failure handler after successful entry or player takeover while waiting. A later refused manual entry can no longer restart startup handling. Keep native fullscreen and the existing screen refresh-rate matching behavior. The reporter reproduced the original failure on four of four Hades II launches and confirmed the readiness fix. The revised callbacks pass all 11 lifecycle harness cases; the original PR fails two. Mac host build, host unit tests, documentation tests and targeted LLVM 23 clang-tidy pass. Regression risk is low and confined to fullscreen startup, so no game regression runs were performed; the revised lifecycle still needs native launcher testing. Co-authored-by: v0lumehi <[email protected]>
What and why
A Mac game started with
DM_FULLSCREEN=1from an app that is itself in macOS fullscreen (the NX2Apple launcher's console mode) comes up as a window. The owner of NX2Apple, @LNPANDY, reported it: "using a full screen app to launch another full-screen app will fail, it will automatically switch to windowed mode".Cause (the state is confirmed, the refusal itself is not): the launcher lives in its own fullscreen Space, so opening the game makes macOS leave that Space.
front_runasked for fullscreen on the next run-loop turn. A harness of two small apps making the same request, with the launcher and the game window on the same display, loggedisOnActiveSpace0 at that moment, and the Space change arrived 0.3 to 0.5 s later. AppKit can refuse a request made then. It reports a refusal only to the window delegate (windowDidFailToEnterFullScreen:), there is noNSWindowDidFailToEnterFullScreenNotificationon macOS.Change, in
dm/host/front_mac.monly:NSApplicationDidBecomeActiveNotificationorNSWorkspaceActiveSpaceDidChangeNotification, whichever comes last).fullscreen was refused.g_fullscreenandscreen_match_applyare unchanged.The alternative is a borderless screen-sized window with no Space of its own, as many games use. The retry comes first because it keeps native fullscreen, which
screen_match_applyrelies on to switch the screen's refresh rate.A separate observation, not changed here: with two displays the game's window did not always open on the display of the launcher (twice on the other one, once on the same). It opens on
NSScreen.mainScreenof a process that is not active yet. That is a follow-up.Reference entry: docs/reference/frame-rate.md, symptom index updated.
Checked
make -C dm/host GAME=010015100B514000builds,make -C dm/host/tests GAME=010015100B514000 runpasses,dm/tools/lint_python.py0 new,dm/tools/tests/test_docs.pypasses.isOnActiveSpace0 (baseline logs:toggleFullScreen: active=1 onActiveSpace=0, thenentered full screen). With the change, the harness waited for the Space change and then entered fullscreen (toggleFullScreen: active=1 onActiveSpace=1). The host code itself was only built, not run in a Space transition. The reporter or anyone with the console mode should confirm.regress.py impact HEAD~1..HEADnames Breath of the Wild, Pokemon Scarlet and Tears of the Kingdom as affected and Hades as broad, only because every call fromfront_runis followed into the NVN loader. The change is in theDM_FULLSCREENbranch of the window setup, which a headlessregress.py checkrun never takes (noDM_WINDOW), so a check would not reach it and none was run.Docs
docs/reference/frame-rate.mdentry, andpython3 dm/tools/docs_symptoms.pywas run (the symptom index)