diff --git a/src/engine/client/input.cpp b/src/engine/client/input.cpp index f94894eca..f590ba8c0 100644 --- a/src/engine/client/input.cpp +++ b/src/engine/client/input.cpp @@ -80,6 +80,7 @@ void CInput::Init() m_pGraphics = Kernel()->RequestInterface(); m_pConsole = Kernel()->RequestInterface(); + m_pConfigManager = Kernel()->RequestInterface(); MouseModeRelative(); @@ -824,6 +825,9 @@ int CInput::Update() } break; case SDL_WINDOWEVENT_MINIMIZED: +#if defined(CONF_PLATFORM_ANDROID) // Save the config when minimized on Android. + m_pConfigManager->Save(); +#endif Graphics()->WindowDestroyNtf(Event.window.windowID); break; diff --git a/src/engine/client/input.h b/src/engine/client/input.h index 70127785f..d0098abf1 100644 --- a/src/engine/client/input.h +++ b/src/engine/client/input.h @@ -14,6 +14,7 @@ #include class IEngineGraphics; +class IConfigManager; class CInput : public IEngineInput { @@ -59,6 +60,7 @@ public: private: IEngineGraphics *m_pGraphics; IConsole *m_pConsole; + IConfigManager *m_pConfigManager; IEngineGraphics *Graphics() const { return m_pGraphics; } IConsole *Console() const { return m_pConsole; }