Re-added SDL_HINT_APP_ID and SDL_HINT_APP_NAME

This commit is contained in:
Sam Lantinga
2024-07-28 14:45:38 -07:00
committed by Ryan C. Gordon
parent 94827e0acd
commit 61a88077a7
4 changed files with 46 additions and 8 deletions

View File

@@ -151,8 +151,15 @@ const char *SDL_GetAppMetadataProperty(const char *name)
return NULL;
}
const SDL_PropertiesID props = SDL_GetGlobalProperties();
const char *value = SDL_GetStringProperty(props, name, NULL);
const char *value = NULL;
if (SDL_strcmp(name, SDL_PROP_APP_METADATA_NAME_STRING) == 0) {
value = SDL_GetHint(SDL_HINT_APP_NAME);
} else if (SDL_strcmp(name, SDL_PROP_APP_METADATA_IDENTIFIER_STRING) == 0) {
value = SDL_GetHint(SDL_HINT_APP_ID);
}
if (!value || !*value) {
value = SDL_GetStringProperty(SDL_GetGlobalProperties(), name, NULL);
}
if (!value || !*value) {
if (SDL_strcmp(name, SDL_PROP_APP_METADATA_NAME_STRING) == 0) {
value = "SDL Application";