diff --git a/osu.Framework/HostOptions.cs b/osu.Framework/HostOptions.cs index 6637713bbb1..c6e7d4dc2f7 100644 --- a/osu.Framework/HostOptions.cs +++ b/osu.Framework/HostOptions.cs @@ -33,5 +33,14 @@ public class HostOptions /// If the SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR environment variable is set, this property will have no effect. /// public bool BypassCompositor { get; set; } = true; + + /// + /// The friendly name of the game to be hosted. This is used to display the name to the user, + /// for example in the window title bar or in OS windows and prompts. + /// + /// + /// If empty, GameHost will choose a default name based on the gameName. + /// + public string FriendlyGameName { get; set; } = string.Empty; } } diff --git a/osu.Framework/Platform/GameHost.cs b/osu.Framework/Platform/GameHost.cs index 43d12550c19..ac269c276ab 100644 --- a/osu.Framework/Platform/GameHost.cs +++ b/osu.Framework/Platform/GameHost.cs @@ -336,6 +336,11 @@ protected GameHost([NotNull] string gameName, [CanBeNull] HostOptions options = { Options = options ?? new HostOptions(); + if (string.IsNullOrEmpty(Options.FriendlyGameName)) + { + Options.FriendlyGameName = $@"osu!framework (running ""{gameName}"")"; + } + Name = gameName; JsonConvert.DefaultSettings = () => new JsonSerializerSettings diff --git a/osu.Framework/Platform/SDL3GameHost.cs b/osu.Framework/Platform/SDL3GameHost.cs index 345c06a13bf..6823a13a337 100644 --- a/osu.Framework/Platform/SDL3GameHost.cs +++ b/osu.Framework/Platform/SDL3GameHost.cs @@ -11,6 +11,7 @@ using osu.Framework.Input.Handlers.Tablet; using osu.Framework.Input.Handlers.Touch; using osu.Framework.Platform.SDL; +using SDL; namespace osu.Framework.Platform { @@ -21,6 +22,8 @@ public abstract class SDL3GameHost : GameHost protected SDL3GameHost(string gameName, HostOptions? options = null) : base(gameName, options) { + if (this is not HeadlessGameHost) + SDL3.SDL_SetHint(SDL3.SDL_HINT_APP_NAME, Options.FriendlyGameName); } protected override TextInputSource CreateTextInput()