Skip to content

Don't pause on lost focus in noninteractive runs - #7896

Open
BTawaifi wants to merge 1 commit into
scp-fs2open:masterfrom
BTawaifi:feature/noninteractive-no-focus-pause
Open

BTawaifi wants to merge 1 commit into
scp-fs2open:masterfrom
BTawaifi:feature/noninteractive-no-focus-pause

Conversation

@BTawaifi

Copy link
Copy Markdown

The game pauses when its window loses focus. With in-game options on, that is governed by the Game.UnfocusedPause option (default on), and the legacy -no_unfocused_pause flag is ignored, as other legacy flags are. A run started with -noninteractive therefore stops as soon as another window is in front, for example when several automated test instances run side by side, and nobody is there to unpause it.

-noninteractive already means nobody is at the keyboard, so pause_if_unfocused() now returns false for it. That covers all three focus paths (game_poll, game_pause, game_unpause). Interactive runs are unchanged, and the option still takes precedence over the legacy flag.

Testing: four windowed -noninteractive instances side by side with the option at its default: before, the background windows paused (GS_EVENT_PAUSE_GAME in the log); after, all ran to the end at full speed with no input.

The game pauses when its window loses focus. With in-game options on, that is
governed by the Game.UnfocusedPause option (default on), and the legacy
-no_unfocused_pause flag is ignored, as other legacy flags are. An unattended
run started with -noninteractive therefore stopped as soon as another window
was in front, for example when several test instances run side by side.

-noninteractive means nobody is at the keyboard to resume the game, so
pause_if_unfocused() now returns false for it. This covers all three focus
paths (game_poll, game_pause, game_unpause). Interactive runs are unchanged.
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.

1 participant