Repository navigation
Mac app: a Game Mode setting, through a nested copy of the host with its own bundle ID - #2283
Open
dontpokethebear3893 wants to merge 3 commits into
Open
dontpokethebear3893 wants to merge 3 commits into
dontpokethebear3893 wants to merge 3 commits into
Conversation
…its own bundle ID The launcher runs Contents/Helpers/Game Mode.app/Contents/MacOS/dmhost (bundle ID <app>.gamemode, LSSupportsGameMode true) when DM_GAME_MODE=1, after registering it with LaunchServices. The app's own ID keeps the key false, so it is never labelled a game, which macOS would remember. Settings row (Performance, Mac only), docs, env switch and test. On an M5 Max, 5 min 50 s in Game Mode at 120 fps (5K output): the GPU clock held about 1,100 MHz and never fell to 338 MHz; 119.8 fps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 11, 2026
# Conflicts: # dm/mac/launcher.c
Brings the branch up to date with main (fixes for the t_save_sync cloud device check and the clang-tidy fixture findings, among others) and resolves the conflicts with it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Mac apps are packed with
LSSupportsGameModefalse, because on an M4 Pro macOS's Game Mode held the GPU at its lowest clock while the game was busy (issue #349;docs/reference/frame-rate.md, "macOS Game Mode holds the GPU at its lowest clock"). That takes Game Mode's benefits away from every Mac, though: less CPU for background tasks, and Bluetooth controllers and AirPods read twice as often.This adds a Game Mode setting to the Mac launcher (Performance, off by default):
pack_app.pygame_mode_helper: every Mac app also carriesContents/Helpers/Game Mode.app. It is a copy of the host with a bundle ID of its own (<app>.gamemode) andLSSupportsGameModetrue. It is signed before the bundle that holds it.launcher.c: withDM_GAME_MODE=1the launcher registers that copy with LaunchServices and runs its host instead ofContents/MacOS/dmhost. If the copy is missing, it logs a[RED]line and runs the game without Game Mode.settings.tsvrow (Mac only),docs/settings.md(Game Mode), theDM_GAME_MODEswitch indocs/env_switches.tsv, and two bullets in the frame-rate entry.Checked
Tests:
dm/tools/teststest_launcher_settingsandtest_nsp_mac_apppass (80 tests).test_nsp_mac_apppacks an app and checks the nested copy's bundle ID, executable, name and key.Games run: Breath of the Wild 1.9.0 (01007EF00011E000), full screen at 120 fps, standing still in the open world, 5 min 50 s with the setting on.
gamepolicydloggedGame mode enabledandSet DPS to 2.Devices and OS: Apple M5 Max, macOS 27.2.1.
Not checked: the same run without Game Mode; the M4 Pro, where the clock fell; other games.
After the rebase on
main(6a6a018):make -C dm/host/tests GAME=01007EF00011E000 run,check_t_feedbackandcheck_t_reorder_chain(dm/gfx/tests) pass.dm/tools/testspasses:test_docs,test_patches,test_game_profile,test_env_switches,test_launcher_settings,test_settings,test_nsp_mac_app,test_fps_target,test_player_env,test_lint_candtest_gfx_tests_makefile.dm/ios/teststest_launcher_storagepasses.lint_python.py --against origin/mainreports one new finding,dm/gfx/tools/dmsh_entry.py:7(F401, an unused import).mainitself reports the same one, and this change does not touch that file.Docs
docs/reference/frame-rate.md(macOS Game Mode holds the GPU at its lowest clock) anddocs/settings.md(Game Mode), andpython3 dm/tools/docs_symptoms.pywas run🤖 Generated with Claude Code