Fix Hedgewars going into suspension mode (game freezes) when windows got minimized
authorWuzzy <Wuzzy2@mail.ru>
Mon, 30 Oct 2017 19:18:53 +0100
changeset 12806 8a359cc248d1
parent 12805 5bdb2f43641e
child 12807 318a0f002128
Fix Hedgewars going into suspension mode (game freezes) when windows got minimized
hedgewars/hwengine.pas
--- a/hedgewars/hwengine.pas	Mon Oct 30 03:37:17 2017 +0100
+++ b/hedgewars/hwengine.pas	Mon Oct 30 19:18:53 2017 +0100
@@ -205,11 +205,18 @@
                                 cHasFocus:= false;
                                 onFocusStateChanged();
                                 end;
+{$IFDEF MOBILE}
+(* Suspend game if minimized on mobile.
+NOTE: Mobile doesn't support online multiplayer yet, so it's not a problem.
+BUT: This section WILL become a bug when online multiplayer is added to
+Hedgewars and needs to be rethought. This is because it will cause the
+game to freeze if one online player minimizes Hedgewars. *)
                         SDL_WINDOWEVENT_MINIMIZED:
                                 begin
                                 previousGameState:= GameState;
                                 GameState:= gsSuspend;
                                 end;
+{$ENDIF}
                         SDL_WINDOWEVENT_RESTORED:
                                 begin
                                 if GameState = gsSuspend then