Skip to content

Commit da4683c

Browse files
committed
Use the Dummy audio driver in the project manager
This prevents Godot from appearing in the list of applications outputting sound in the OS while the user is in the project manager.
1 parent eabeafd commit da4683c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

main/main.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -2338,7 +2338,14 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
23382338

23392339
GLOBAL_DEF_RST_NOVAL("audio/driver/driver", AudioDriverManager::get_driver(0)->get_name());
23402340
if (audio_driver.is_empty()) { // Specified in project.godot.
2341-
audio_driver = GLOBAL_GET("audio/driver/driver");
2341+
if (project_manager) {
2342+
// The project manager doesn't need to play sound (TTS audio output is not emitted by Godot, but by the system itself).
2343+
// Disable audio output so it doesn't appear in the list of applications outputting sound in the OS.
2344+
// On macOS, this also prevents the project manager from inhibiting suspend.
2345+
audio_driver = "Dummy";
2346+
} else {
2347+
audio_driver = GLOBAL_GET("audio/driver/driver");
2348+
}
23422349
}
23432350

23442351
// Make sure that dummy is the last one, which it is assumed to be by design.

0 commit comments

Comments
 (0)