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 Window.AllowAltF4 For SDLGamePlatform #8248

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 17 additions & 1 deletion MonoGame.Framework/Platform/SDL/SDLGamePlatform.cs
Expand Up @@ -93,11 +93,27 @@ public override void RunLoop()
Threading.Run();
GraphicsDevice.DisposeContexts();

if (_isExiting > 0)
if (_isExiting > 0 && ShouldExit())
{
break;
}
else
{
_isExiting = 0;
}
}
}

private bool ShouldExit()
{
if(_keys.Contains(Keys.F4) && (_keys.Contains(Keys.LeftAlt) || _keys.Contains(Keys.RightAlt)))
{
return Window.AllowAltF4;
}

return true;
}

private void SdlRunLoop()
{
Sdl.Event ev;
Expand Down