Skip to content

Console mode: the pointer stays hidden while a game starts (#380) - #741

Merged
v0lumehi merged 4 commits into
LNPANDY:mainfrom
Haseenesss:fix/380-console-pointer-flash
Nov 5, 2026
Merged

v0lumehi merged 4 commits into
LNPANDY:mainfrom
Haseenesss:fix/380-console-pointer-flash

Conversation

@Haseenesss

@Haseenesss Haseenesss commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Fix or feature

  • Fix
  • Feature

What and why

Fixes #380. Starting a game from console mode still showed the pointer, although #374 starts the game with DM_CURSOR_HIDDEN=1. Measured with screen recordings of Balatro (0100CD801CE5E000), three things showed it:

  1. The launcher itself, for seconds. The console leaves full screen before it opens the game (leaveFullScreenForGame). The pointer is then no longer over the smaller window, and ConsolePointer's not-over rule showed it for the whole "preparing" time (about 9 s in the first start). PointerIdle now has held: while a game starts from the console, a hidden pointer stays hidden outside the window. Movement, a click or a scroll still show it, and the hold ends when the game has quit or did not start (resumeFullScreenAfterGame) or the console ends.
  2. LaunchServices activating the game, 35-220 ms. An app LaunchServices activates when it registers shows the pointer for a few frames, whatever it hid before (a minimal test app: 6 of 6 starts). With the pointer hidden, the console now opens the game with activates = false and yieldActivation(toApplicationWithBundleIdentifier:), and the game activates itself (macOS 14 and later; macOS 13 keeps today's path). A started game that is not hiding the pointer is opened as before.
  3. The game hid it too late. The host hid the pointer only after it had made its window, asked for full screen and activated. Patch 0075 hides it right after NSApplication is created, and activates the app from the run loop rather than in the middle of the setup: an app that takes the front while its main thread is busy still showed the pointer for a frame in 2 of 8 starts.

The engine change goes to seedds/nxnative as a PR next. The patch says pending until then.

Checked

  • Tests: cd frontend && swift test on this branch (rebased on main 8d13135): 749 tests, 0 failures. A first run on a busy machine had 8 failures that did not come back in the second run. python3 tools/engine.py check: 42 patches apply cleanly to upstream 777a5f6c618a. New tests: testAGameStartedWithThePointerHiddenGetsTheFrontYielded, testAHeldPointerStaysHiddenOutsideTheWindowUntilItMoves.
  • Run on a Mac (M2, macOS 27.2, Xcode 27.2), with Balatro 1.1.3 (0100CD801CE5E000), pointer presence read frame by frame from screen recordings:
    • A stand-in for the console that hides the pointer and opens the game as LiveConsoleDriver does: before, 5 of 5 starts showed the pointer when the game took the front (35-220 ms). With the front yielded, the early hide and the activation from the run loop: 0 of 10.
    • End to end: an app built with tools/try-local from this change on main 7ef881b (before the rebase), Balatro rebuilt in it, started from console mode with the pointer idle-hidden. Before the launcher change, the pointer came back when the window left full screen and stayed about 9 s. After it, 2 of 2 starts showed no pointer from Play until the game's picture.
  • Not checked: macOS 13 (no yieldActivation, it keeps today's path), a start with a controller instead of the keyboard, the end-to-end run on the rebased branch (the code is the same, the engine pin moved).

Screenshots

None, no visible change.

Scope

  • No engine file (dm/, scripts/, docs/, ref/) is added to the repository: a change there is a patch in patches/ (a commit in engine/, then tools/engine.py export, and tools/engine.py check passes), with its Upstream-Status
  • A fix to the engine or a game profile also goes to seedds/nxnative as a PR in parallel: this PR's patch says forwarded seedds/nxnative#..., or pending until that PR is open
  • A change to a launcher view has before and after screenshots above (no view changes here)
  • No keys, game files or data extracted from a game in the change or the attachments

🤖 Generated with Claude Code

Three things showed the pointer between the console and a game started from it:

- The window leaves full screen before the game opens, and the pointer, no longer over the smaller window, came back for the whole "preparing" time. ConsolePointer now holds a hidden pointer while a game starts, until the game has quit or did not start; movement, a click or a scroll still show it.
- LaunchServices activating the game shows the pointer for up to 150 ms, whatever the game hid. With the pointer hidden the console now yields the front to the game (macOS 14 and later), and the game activates itself.
- The game hid the pointer only after it had taken the front. Patch 0073 hides it right after NSApplication is created and activates from the run loop.

Measured with Balatro (1.1.3) from console mode in a build of this branch: no pointer from Play until the game's picture, in two starts, where the first start before this change showed it for about 9 s.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added launcher The NX2Apple launcher app patch-queue Changes the patch queue or the upstream pin labels Nov 5, 2026
@v0lumehi v0lumehi added this to the v1.2.0 milestone Nov 5, 2026
@v0lumehi
v0lumehi merged commit ecb6819 into LNPANDY:main Nov 5, 2026
17 checks passed
@v0lumehi

v0lumehi commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

Merged, thank you @Haseenesss. The patch keeps the number 0075, which is the next free one on main.

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

Labels

launcher The NX2Apple launcher app patch-queue Changes the patch queue or the upstream pin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cursor shows again when a game starts from console mode in fullscreen

2 participants