-
Notifications
You must be signed in to change notification settings - Fork 423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set SDL_HINT_APP_NAME in SDL3GameHost constructor #6260
Conversation
be08bac
to
7cdb50f
Compare
7cdb50f
to
952c594
Compare
952c594
to
dc818d5
Compare
appName
parameter to window constructors & CreateWindowdc818d5
to
a202b5a
Compare
a202b5a
to
608c487
Compare
I suppose this works, but my main question here is - what is the intent with respect to the game-side override of the window title (see here and then here)? Like as far as I can tell, you can't actually move that title logic out to use Like it's either going to be this: diff --git a/osu.Desktop/Program.cs b/osu.Desktop/Program.cs
index 29b05a402f..1dafe0d9ff 100644
--- a/osu.Desktop/Program.cs
+++ b/osu.Desktop/Program.cs
@@ -107,7 +107,11 @@ public static void Main(string[] args)
}
}
- using (DesktopGameHost host = Host.GetSuitableDesktopHost(gameName, new HostOptions { IPCPort = !tournamentClient ? OsuGame.IPC_PORT : null }))
+ using (DesktopGameHost host = Host.GetSuitableDesktopHost(gameName, new HostOptions
+ {
+ IPCPort = !tournamentClient ? OsuGame.IPC_PORT : null,
+ FriendlyGameName = "osu!"
+ }))
{
if (!host.IsPrimaryInstance)
{
as a best-effort, or something like diff --git a/osu.Desktop/Program.cs b/osu.Desktop/Program.cs
index 29b05a402f..d8364fc6e6 100644
--- a/osu.Desktop/Program.cs
+++ b/osu.Desktop/Program.cs
@@ -107,7 +107,11 @@ public static void Main(string[] args)
}
}
- using (DesktopGameHost host = Host.GetSuitableDesktopHost(gameName, new HostOptions { IPCPort = !tournamentClient ? OsuGame.IPC_PORT : null }))
+ using (DesktopGameHost host = Host.GetSuitableDesktopHost(gameName, new HostOptions
+ {
+ IPCPort = !tournamentClient ? OsuGame.IPC_PORT : null,
+ FriendlyGameName = OsuGameBase.GAME_NAME,
+ }))
{
if (!host.IsPrimaryInstance)
{
diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs
index fb7a238c46..6654b39137 100644
--- a/osu.Game/OsuGameBase.cs
+++ b/osu.Game/OsuGameBase.cs
@@ -75,6 +75,12 @@ public partial class OsuGameBase : Framework.Game, ICanAcceptFiles, IBeatSyncPro
{
public static readonly string[] VIDEO_EXTENSIONS = { ".mp4", ".mov", ".avi", ".flv", ".mpg", ".wmv", ".m4v" };
+#if DEBUG
+ public const string GAME_NAME = "osu! (development)";
+#else
+ public const string GAME_NAME = "osu!";
+#endif
+
public const string OSU_PROTOCOL = "osu://";
public const string CLIENT_STREAM_NAME = @"lazer";
@@ -241,11 +247,7 @@ public virtual string Version
public OsuGameBase()
{
- Name = @"osu!";
-
-#if DEBUG
- Name += " (development)";
-#endif
+ Name = GAME_NAME;
allowableExceptions = UnhandledExceptionsBeforeCrash;
}
I guess? Food for thought as to whether things can be done better API-design-wise I guess. I'm probably fine with either resolution myself. |
Both of those diffs look reasonable to me. As far I've convinced myself, its purpose is not the same as the window title so I wouldn't see us doing anything around that:
|
Supersedes #5650. Closes ppy/osu#25783.
The docs say that
Since
SDL_Init
is called in theSDL3Window
constructor, this means that the application name must be known at that point in time. So it's not possible to rely on the window title.This appName value is then used to tell SDL the application name to show in OS windows, prompts, etc.:
The
appName
could arguably be used as the initial window title.