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

Pause on focus loss #240

Open
wants to merge 1 commit into
base: nightly
Choose a base branch
from

Conversation

mimblybimbly
Copy link

Resolves #191

This is a PR to add an option to auto pause when window focus is lost. The option currently defaults to false. It will pause the game if the window loses focus, and resume if it regains focus (user clicks on window, or alt-tabs to game). Similarly it works in full-screen mode, if the user alt-tabs out of the game it pauses, and resumes if they alt-tab back.

I also experimented with having the loss of focus result in the game showing the pause menu, as if the player had pressed start, but obviously that only works in game-play, and the game wouldn't pause until cut-scenes, transitions or dialog had finished. If people would rather it behave like that, I can add that instead.

@ffdiego
Copy link

ffdiego commented May 22, 2020

In my opinion it would be a good feature to add a START keypress on
case SDL_WINDOWEVENT_FOCUS_LOST:
that way the game doesn't immediately resumes after alt-tabbing back, and cutscenes remain paused as well.

theclashingfritz referenced this pull request in djoslin0/sm64ex-coop Feb 22, 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.

2 participants