1
0
Fork 0

Feature: Set application name for SDL2

This is used for e.g. screensaver inhibitor description.
pull/12824/head
Valeri 2024-06-27 14:40:46 +03:00 committed by GitHub
parent a288644e20
commit 6fe55cf458
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -523,6 +523,8 @@ static std::optional<std::string_view> InitializeSDL()
/* Check if the video-driver is already initialized. */ /* Check if the video-driver is already initialized. */
if (SDL_WasInit(SDL_INIT_VIDEO) != 0) return std::nullopt; if (SDL_WasInit(SDL_INIT_VIDEO) != 0) return std::nullopt;
SDL_SetHint(SDL_HINT_APP_NAME, "OpenTTD");
if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) return SDL_GetError(); if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) return SDL_GetError();
return std::nullopt; return std::nullopt;
} }