# HG changeset patch # User antonc27 # Date 1521154760 -3600 # Node ID 01ab48b253ef4e396964d807dd6c20d2c9df27d4 # Parent 915abf27ae5a10a95c613b266098c7c42cd9d3e5 - Pause game when it goes background (do not show anymore annoying 'confirm quit') diff -r 915abf27ae5a -r 01ab48b253ef hedgewars/uWorld.pas --- a/hedgewars/uWorld.pas Thu Mar 15 23:24:48 2018 +0100 +++ b/hedgewars/uWorld.pas Thu Mar 15 23:59:20 2018 +0100 @@ -1995,12 +1995,14 @@ procedure onFocusStateChanged; begin -if (not cHasFocus) and (GameState <> gsConfirm) then - ParseCommand('quit', true); {$IFDEF MOBILE} +if (not cHasFocus) and (not isPaused) then + ParseCommand('pause', true); // when created SDL receives an exposure event that calls UndampenAudio at full power, muting audio exit; {$ENDIF} +if (not cHasFocus) and (GameState <> gsConfirm) then + ParseCommand('quit', true); {$IFDEF USE_VIDEO_RECORDING} // do not change volume during prerecording as it will affect sound in video file