From: DeaDDooMER Date: Sat, 15 Sep 2018 06:39:03 +0000 (+0300) Subject: Android: Fix menu reset when open keyboard X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=234032319b08fb5fc2d4fdb2fc38971fe38809eb;p=d2df-sdl.git Android: Fix menu reset when open keyboard --- diff --git a/src/game/g_window.pas b/src/game/g_window.pas index c3f6871..3958d24 100644 --- a/src/game/g_window.pas +++ b/src/game/g_window.pas @@ -234,7 +234,7 @@ begin end; -procedure ChangeWindowSize (); +procedure ChangeWindowSize (requested: Boolean); begin e_LogWritefln(' ChangeWindowSize: (ws=%dx%d) (ss=%dx%d)', [gWinSizeX, gWinSizeY, gScreenWidth, gScreenHeight]); gWinSizeX := gScreenWidth; @@ -246,7 +246,13 @@ begin {$ENDIF} e_ResizeWindow(gScreenWidth, gScreenHeight); g_Game_SetupScreenSize(); - g_Menu_Reset(); + {$IF DEFINED(ANDROID)} + (* This will fix menu reset on keyboard showing *) + if requested then + g_Menu_Reset; + {$ELSE} + g_Menu_Reset; + {$ENDIF} g_Game_ClearLoading(); {$ENDIF} end; @@ -281,7 +287,7 @@ begin if result then begin g_Window_SetDisplay(preserve); - ChangeWindowSize(); + ChangeWindowSize(true); end; {$ENDIF} end; @@ -337,7 +343,7 @@ begin gScreenWidth := ev.data1; gScreenHeight := ev.data2; end; - ChangeWindowSize(); + ChangeWindowSize(false); SwapBuffers(); if g_debug_WinMsgs then begin