hedgewars/hwengine.pas
changeset 15320 3bf780084c86
parent 14917 63357ed39886
child 15908 014f4edd0421
child 15979 668c88b31dd6
--- a/hedgewars/hwengine.pas	Tue Aug 06 11:41:38 2019 +0200
+++ b/hedgewars/hwengine.pas	Tue Aug 06 19:00:51 2019 +0200
@@ -230,11 +230,14 @@
                                 begin
                                 if GameState = gsSuspend then
                                     GameState:= previousGameState;
+                                cWindowedMaximized:= false;
 {$IFDEF ANDROID}
                                 //This call is used to reinitialize the glcontext and reload the textures
                                 ParseCommand('fullscr '+intToStr(LongInt(cFullScreen)), true);
 {$ENDIF}
                                 end;
+                        SDL_WINDOWEVENT_MAXIMIZED:
+                                cWindowedMaximized:= true;
                         SDL_WINDOWEVENT_RESIZED:
                                 begin
                                 cNewScreenWidth:= max(2 * (event.window.data1 div 2), cMinScreenWidth);
@@ -302,12 +305,18 @@
             cScreenHeight:= cWindowedHeight;
 
             ParseCommand('fullscr '+intToStr(LongInt(cFullScreen)), true);
-            WriteLnToConsole('window resize: ' + IntToStr(cScreenWidth) + ' x ' + IntToStr(cScreenHeight));
+            if cWindowedMaximized then
+                WriteLnToConsole('window resize: ' + IntToStr(cScreenWidth) + ' x ' + IntToStr(cScreenHeight) + ' (maximized)')
+            else
+                WriteLnToConsole('window resize: ' + IntToStr(cScreenWidth) + ' x ' + IntToStr(cScreenHeight));
             ScriptOnScreenResize();
             InitCameraBorders();
             InitTouchInterface();
             InitZoom(zoomValue);
-            SendIPC('W' + IntToStr(cScreenWidth) + 'x' + IntToStr(cScreenHeight));
+            if cWindowedMaximized then
+                SendIPC('W' + IntToStr(cScreenWidth) + 'x' + IntToStr(cScreenHeight) + 'M')
+            else
+                SendIPC('W' + IntToStr(cScreenWidth) + 'x' + IntToStr(cScreenHeight));
         end;
 
         CurrTime:= SDL_GetTicks();