diff --git a/src/posix/cocoa/i_video.mm b/src/posix/cocoa/i_video.mm index c89a6601d..2c305b49e 100644 --- a/src/posix/cocoa/i_video.mm +++ b/src/posix/cocoa/i_video.mm @@ -1523,10 +1523,16 @@ void I_SetMainWindowVisible(bool visible) // each platform has its own specific version of this function. void I_SetWindowTitle(const char* title) { - static NSString* const TITLE_STRING; if (title) - TITLE_STRING = [NSString stringWithFormat:@"%s", title]; + { + static NSString* const TITLE_STRING = + [NSString stringWithFormat:@"%s", title]; + [m_window setTitle:TITLE_STRING]; + } else - TITLE_STRING = [NSString stringWithFormat:@"%s %s", GAMESIG, GetVersionString()]; - [m_window setTitle:TITLE_STRING]; -} \ No newline at end of file + { + static NSString* const TITLE_STRING = + [NSString stringWithFormat:@"%s %s", GAMESIG, GetVersionString()]; + [m_window setTitle:TITLE_STRING]; + } +} diff --git a/src/posix/sdl/sdlvideo.cpp b/src/posix/sdl/sdlvideo.cpp index 318a91e6e..6a0420ae8 100644 --- a/src/posix/sdl/sdlvideo.cpp +++ b/src/posix/sdl/sdlvideo.cpp @@ -556,11 +556,12 @@ ADD_STAT (blit) void I_SetWindowTitle(const char* caption) { if (caption) - SDL_SetWindowTitle(Screen, caption); + SDL_SetWindowTitle(static_cast(screen)->GetSDLWindow(), caption); else { FString default_caption; default_caption.Format(GAMESIG " %s (%s)", GetVersionString(), GetGitTime()); - SDL_SetWindowTitle(Screen, default_caption); + SDL_SetWindowTitle(static_cast(screen)->GetSDLWindow(), default_caption); } } +