From 6fe55cf458ef84632c6be7de02e41511f0ee5d14 Mon Sep 17 00:00:00 2001 From: Valeri Date: Thu, 27 Jun 2024 14:40:46 +0300 Subject: [PATCH] Feature: Set application name for SDL2 This is used for e.g. screensaver inhibitor description. --- src/video/sdl2_v.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/video/sdl2_v.cpp b/src/video/sdl2_v.cpp index 08723ef3b6..49e53e00b0 100644 --- a/src/video/sdl2_v.cpp +++ b/src/video/sdl2_v.cpp @@ -523,6 +523,8 @@ static std::optional InitializeSDL() /* Check if the video-driver is already initialized. */ 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(); return std::nullopt; }