Repository navigation
A Mac game opens on the display of the launcher's window (DM_SCREEN) - #221
Merged
Merged
Conversation
v0lumehi
added a commit
that referenced
this pull request
Oct 29, 2026
This was referenced Oct 29, 2026
LNPANDY
pushed a commit
that referenced
this pull request
Oct 29, 2026
LNPANDY
force-pushed
the
v0lumehi/game-on-launcher-screen
branch
from
October 29, 2026 20:16
941a6e3 to
07375e2
Compare
This was referenced Oct 29, 2026
LNPANDY
pushed a commit
that referenced
this pull request
Oct 29, 2026
LNPANDY
force-pushed
the
v0lumehi/game-on-launcher-screen
branch
from
October 29, 2026 21:19
07375e2 to
4bd7b78
Compare
A Mac game window opened on another display than the launcher's in 2 of 3 runs with two displays. DM_SCREEN=<NSScreenNumber> centres the window on that connected screen before it is shown and before any DM_FULLSCREEN request. Unset or unknown, nothing changes.
…her's window Play (library and console mode, both through GameStart.environment) adds DM_SCREEN with the NSScreenNumber of the launcher window's screen, else the main screen.
Collaborator
Author
|
Rebased onto main after #219 and the pin bump #223. Patch 0031 now sits after 0030 and applies on pin a662f29. The patch and the launcher change were redone on the new tree, so |
v0lumehi
force-pushed
the
v0lumehi/game-on-launcher-screen
branch
from
October 29, 2026 21:41
4bd7b78 to
cee5541
Compare
Merged
3 tasks done
5 of 6 tasks
4 of 6 tasks
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's window opened on the other display than the launcher's in 2 of 3 runs (found with the fullscreen work in #219 and seedds/nxnative#665). The game is a process that is not active yet when it opens its window, so macOS picks the screen. Console mode on an external display could therefore start its game on the built-in one.
Upstream-Status: forwarded seedds/nxnative#670): a new switchDM_SCREEN=<number>, theNSScreenNumber(CGDirectDisplayID). When a connected screen has that number, the window is centred there before it is shown and before anyDM_FULLSCREENrequest. Unset or unknown: unchanged, with one log line either way. ItsIssue:line names this PR, as there is no separate issue. Number 0031 as agreed (main has 0027, Cheats sheet in the launcher, carrying seedds/nxnative#406 #218 becomes 0028 and 0029, Carry seedds/nxnative#665: fullscreen for a game opened from a fullscreen app #219 becomes 0030). The patch applies on current main alone.GameStart.environment, which both the library's Play and console mode use, addsDM_SCREENwith the display ID ofNSApp.keyWindow?.screen ?? NSScreen.main. Nothing else in the launch flow changes.Combined with #219: that PR makes the game wait until the app and its Space are active before it asks for fullscreen. This one only places the window first, so from console mode the game's fullscreen request is made on the launcher's display. The two touch neighbouring lines in
front_mac.mbut do not conflict logically.@LNPANDY could you try it together with #219 from console mode on an external display? The launcher on the external display should give a game that opens, and goes fullscreen, there.
Checked
python3 scripts/patches.py checkpasses,python3 -m unittest discover -s scripts/testspasses (39 tests),make -C dm/host GAME=010015100B514000builds,make -C dm/host/tests GAME=010015100B514000 runpasses,dm/tools/env_switches.py --checkpasses,cd frontend && swift build -c release && swift testpasses (403 tests, 13 skipped as before). New:GameStartScreenTestsand a line inConsoleLiveTests.testPlayRoutesToTheLaunchWithTheDesktopEnvironment, which check the value both launch paths get.ignoredand kept the default, unset kept the default. No game was started with the new host, and the launcher was not run with two displays by hand.Scope
patches/(patches.py checkpasses), with itsUpstream-Statusforwarded seedds/nxnative#670)