Index: source/gui/CInput.h =================================================================== --- source/gui/CInput.h +++ source/gui/CInput.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2017 Wildfire Games. +/* Copyright (C) 2018 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -126,6 +126,9 @@ /// Updates the buffer (cursor) position exposed to JS. void UpdateBufferPositionSetting(); + + // Stop the SDL text input when field is destroyed, so a next field doesn't get old textEvents. + void Destroy(); protected: /// Cursor position int m_iBufferPos; Index: source/gui/CInput.cpp =================================================================== --- source/gui/CInput.cpp +++ source/gui/CInput.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2017 Wildfire Games. +/* Copyright (C) 2018 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -2136,3 +2136,8 @@ m_HorizontalScroll = 0.f; } } + +void CInput::Destroy() +{ + SDL_StopTextInput(); +}