Repository navigation
Conversation
3 tasks done
2 tasks done
lucaszhongsj
pushed a commit
to lucaszhongsj/nxnative
that referenced
this pull request
Nov 19, 2026
Upstream-Status: forwarded seedds#670 Reason: a game opens on the launcher's display only with this switch until upstream merges it Issue: LNPANDY/NX2Apple#221
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.
What and why
With two displays, a Mac game window opened on the other display than the launcher's in 2 of 3 runs (seen while testing the fullscreen work in #665). The window is created by a process that is not active yet, so macOS picks the screen itself. A launcher that wants the game on its own display (for example the display console mode runs on) had no way to say so.
Change: a new switch
DM_SCREEN=<number>, theNSScreenNumber(CGDirectDisplayID) fromNSScreen.deviceDescription. When a connected screen has that number,front_runcentres the window in that screen's visible frame, after the window is created and before it is shown, so before anyDM_FULLSCREENrequest. The window size is unchanged. When it is unset, or no connected screen has that number, nothing changes. One log line names the screen used or says why the number was ignored. Documented indocs/env_switches.tsvanddocs/development.md.Neighbouring code: #665 changes the
DM_FULLSCREENrequest a few lines further down in the same function. The two are independent (this one touches only the window's position, #665 only when the fullscreen request is made) and combine in the order position first, request second: the window is on the chosen screen when #665 waits for the app to be active and the Space to be active, so fullscreen is entered on that screen.Checked
make -C dm/host GAME=010015100B514000builds,make -C dm/host/tests GAME=010015100B514000 runpasses,dm/tools/lint_python.py0 new,dm/tools/env_switches.py --checkpasses,dm/tools/tests/test_docs.pypasses.DM_SCREENset to each display's number put the window on it (win.screenmatched), an unknown number loggedignoredand left the default screen, unset left the default. The host itself was built, not run with a window, and not combined with front_mac: enter fullscreen once the app is active and on the active Space #665 in a Space transition.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 the window setup, which a headlessregress.py checkrun never reaches (noDM_WINDOW), so no check was run.Docs
docs/reference/<subsystem>.mdentry: not applicable, a new switch and not a finding. It is indocs/env_switches.tsvanddocs/development.md