Repository navigation
iOS: quit a game from the in-game menu or by holding Home - #601
Merged
Merged
Conversation
…g Home (#421) 0068 ends the gear's in-game menu with Quit <game> and opens a quit prompt over the game, the Mac's in look, from it or from a 2 s Home hold. Quitting flushes the cloud saves and ends the app as on SIGTERM. One game runs per process, so the player opens the app again. Forwarded as seedds/nxnative#1115. 0069 makes the shell compile GameMenu.swift, which the gear needs. At the 641d148 pin the shell does not link without it.
Every game gets DM_HOME_QUIT_TEXT in the player's language, as the Mac launcher passes it for its Home button prompt. The engine shows the prompt for Quit in the in-game menu and for a held Home button. Texts in all six languages, the note in it, sv, de and fr machine-translated.
This was referenced Nov 3, 2026
4 of 6 tasks
1 task done
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.
Fix or feature
A maintainer's feature (#421, milestone v1.1.0). It stacks on #598, the engine bump to 641d148, because it extends that pin's in-game menu. It is reviewed against #598 and merges after it.
What and why
Fixes #421
On the iPhone a running game had no way back to the launcher. The player had to close the app in the app switcher. A player asked for an "exit game" button.
The design
There is one way back for touch, plus the Home button for controllers. I did not add a second on-screen control.
GameMenu.swift). The menu now ends with "Quit ", red and on its own. The gear stays while a controller hides the other touch controls, so touch players and controller players reach it the same way. A stray tap on the gear only opens the menu.GCControllerHomeButtonSettingsManager, in the iOS 27.2 SDK). The game's log names the setting once. On iOS 26, or with the setting left to the system, Quit in the menu still works.What quitting does
The engine runs one game per process. The game profile and the early loading run once, and a second Play in the same session is refused (
ShellMain.m). So the engine cannot hand the window back to the library. iOS also has no way for an app to start itself again.So Quit does the same steps as the app going to the background and then a SIGTERM:
save_sync_flush, as when the app goes to the background).dm_host_shutdown).What the game saved is on disk already. The note says it plainly: unsaved progress is lost, the app closes and opens on your games next time. When the player opens it again, the shell shows the library with that game first.
The patches
0068-ios-quit-a-game-from-the-in-game-menu-or-by-hold.patch: the menu item, the prompt (quit_prompt.h, Core Animation and Core Text only), the iOS Home hold on upstream'shome_quit.h, and the quit steps.Upstream-Status: forwarded seedds/nxnative#1115. It differs from upstream in one line: the fork reads the game's name fromdm_profile()->name(0001), upstream fromDM_GAME_NAME.0069-ios-shell-compile-the-in-game-menu-so-the-gear-o.patch: the shell compilesGameMenu.swiftandLauncherSettings.swift, as the Duo harness does.fork-only, because the shell is the fork's (0050). At the 641d148 pin the shell does not link without it.DmGamepad.m's gear callsdm_game_menu, which onlyGameMenu.swiftdefines.test_shell_build.pyon Engine pin: seedds/nxnative 641d1480021a (52 commits ahead) #598 alone fails withUndefined symbols: _dm_game_menu. With 0069 it passes.DM_HOME_QUIT_TEXTin the player's language (ios.host.quit*), as the Mac launcher does for its prompt. The hold, title, Quit and Cancel texts reuse the Mac'shomeQuit.*translations. The new note in it, sv, de and fr is machine-translated and needs a native look. zh is mine.Whoever merges renumbers 0068 and 0069 if
mainhas taken those numbers.Checked
python3 -m unittest dm/ios/tests/test_quit_prompt.py: the touch steps of the state machine, and the layout on iPhone, iPad and Duo screens in six languages.test_shell_build.pywithDM_SHELL_PACKAGE=frontend-ios: the shell is generated and built unsigned.test_pad_geometry.py.GAME=010015100B514000 python3 dm/ios/tools/compile_check.py: 262 files, 0 failed, both passes.t_home_quit: 40 checks.python3 tools/engine.py check.swift test --package-path frontend-ios: 136 tests. Two of them are new: the prompt's texts reach every game with its name, and the texts follow the rules in every language.tools/l10n_shell_catalogs.py --check, the l10n tool tests and the Qt l10n tests.QP_CAPTURE_DIR=<dir> python3 -m unittest dm/ios/tests/test_quit_prompt.pydraws the prompt with the same layers the game uses, on the Mac.Screenshots
There was no prompt before, so there is no before picture. The gear menu with Quit could not be captured (see above).
After, iPhone 15 size, English, German and Chinese. Both pills have the same width in every language:
iPhone SE size:
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#..., orpendinguntil that PR is open