Skip to content
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

Respect setting Window.Title in Game1 constructor #8052

Merged
merged 1 commit into from
Sep 10, 2023
Merged

Respect setting Window.Title in Game1 constructor #8052

merged 1 commit into from
Sep 10, 2023

Conversation

AristurtleDev
Copy link
Contributor

Description

When setting the Window.Title in the Game1 constructor, the title set is ignored. This is because the SDLGameWindow.CreateWindow() method explicitly chooses to use AssemblyHelper.GetDefaultWindowTItle(). During this time, the SDLGameWindow.Title property contains the correct window title that is set during the Game1 constructor, but ignores this.

This PR resolves this issue by explicitly checking if SDLGameWindow.Title is null, and if so, then it will use AssemblyHelper.GetDefaultWindowTitle(), otherwise it will use the title that was set by the user in the Game1 constructor as expected.

Reference:
An issue was opened previously at Issue #7913

Note:
This PR is also related to PR #8051, however I created two separate PRs as each focuses on a separate issue to fix.

@harry-cpp
Copy link
Member

Looks good to me, thanks @AristurtleDev , merging!

@harry-cpp harry-cpp merged commit 1613e0d into MonoGame:develop Sep 10, 2023
@AristurtleDev AristurtleDev deleted the fix/WindowTitleInGameCtor branch September 11, 2023 06:31
viniciusjarina pushed a commit to codefoco/MonoGame that referenced this pull request Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants