Repository navigation
Keep the pointer hidden when console mode starts a game - #374
Conversation
e1f56a1 to
44826ab
Compare
The game is a new process, so its pointer showed again from the moment the launcher lost focus until its own idle wait ended. The console now sets DM_CURSOR_HIDDEN=1 when its pointer is hidden at Play, and the game starts hidden (patch 0054).
44826ab to
2982c6e
Compare
|
@v0lumehi I tried v0.8.0 RC3 which was built from this commit. Sadly, in my testing, starting a game from console mode fullscreen still shows the mouse cursor that was previously hidden when transitioning from NX2Apple console mode -> fullscreen game. The mouse idle time/cursor disappearance has been sped up and feels good now, I think a way to improve it paired with the future always-console mode toggle on launch is to immediately keep the cursor hidden if NX2Apple launches with that toggle enabled instead of the current wait time it is now when prompted if the user wants the console mode on controller recognition. It might be as you said though where due to the hide being per app it's showing the mouse cursor again during that transition due to how MacOS handles it. |
Fix or feature
What and why
@volcoice reported on #368 (v0.8.0 RC1): in console mode fullscreen the pointer is hidden. When the game goes fullscreen, it shows again for a moment. Leaving the game back to console mode is fine.
Cause:
NSCursor.hide()inConsolePointer.swift. That hide belongs to the launcher process.ConsolePointer.look()seesover == falseand callsunhide. The pointer is visible from then on.front_mac.m(patch 0032) it starts withhidden = 0and hides only afterDM_CURSOR_HIDEidle seconds, counted from its start. So the pointer stays visible through the whole fullscreen transition.hiddenstate and the game process ends.Change:
DM_CURSOR_HIDDEN=1to the game's environment (LiveConsoleDriver.play,ConsoleCoordinator.pointerHidden).NSCursor.hideat start and begins hidden. The not-over rule is held back until the pointer has been over the game window once, because a new window is not key when the timer first runs. After that the normal rule applies.Part of #335. This touches
ConsolePointer.swiftby one accessor. #359 (fix/console-pointer-idle) changes the idle time in the same file. The edits are in different lines, so I expect no conflict. The new test is inConsoleLiveTests.swift, which #359 does not touch.Checked
testAGameStartsWithThePointerHiddenWhenTheConsoleHadItHiddenfailed first (nilis not equal to"1") and passes now.cd frontend && swift build && swift testpasses (652 tests, 0 failures).python3 tools/engine.py checkpasses.test_env_switches.pyfor the new row passes on the nxnative branch.Screenshots
None, no visible change.
Scope
dm/,scripts/,docs/,ref/) is added to the repository: a change there is a patch inpatches/(a commit inengine/, thentools/engine.py export, andtools/engine.py checkpasses), with itsUpstream-Statusforwarded seedds/nxnative#839