From f8f76eb9f36add0e527ec50ef77fea3c133f41b5 Mon Sep 17 00:00:00 2001 From: stormcone <48624099+stormcone@users.noreply.github.com> Date: Tue, 1 Apr 2025 16:07:38 +0200 Subject: [PATCH] Fix 089c7a2: SDL2 application name hint was not effective. (#13926) --- src/video/sdl2_v.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/video/sdl2_v.cpp b/src/video/sdl2_v.cpp index 8cea6be506..0863719a88 100644 --- a/src/video/sdl2_v.cpp +++ b/src/video/sdl2_v.cpp @@ -535,6 +535,10 @@ static std::optional InitializeSDL() /* Check if the video-driver is already initialized. */ if (SDL_WasInit(SDL_INIT_VIDEO) != 0) return std::nullopt; +#ifdef SDL_HINT_APP_NAME + SDL_SetHint(SDL_HINT_APP_NAME, "OpenTTD"); +#endif + if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) return SDL_GetError(); return std::nullopt; } @@ -568,10 +572,6 @@ std::optional VideoDriver_SDL_Base::Start(const StringList &pa } #endif -#ifdef SDL_HINT_APP_NAME - SDL_SetHint(SDL_HINT_APP_NAME, "OpenTTD"); -#endif - this->startup_display = FindStartupDisplay(GetDriverParamInt(param, "display", -1)); if (!CreateMainSurface(_cur_resolution.width, _cur_resolution.height, false)) {