diff --git a/source/Irrlicht/CIrrDeviceSDL.cpp b/source/Irrlicht/CIrrDeviceSDL.cpp index 72f1b8c3..f761a13d 100644 --- a/source/Irrlicht/CIrrDeviceSDL.cpp +++ b/source/Irrlicht/CIrrDeviceSDL.cpp @@ -224,7 +224,7 @@ void CIrrDeviceSDL::resetReceiveTextInputEvents() { // sent as text input events instead of the result) when // SDL_StartTextInput() is called on the same input box. core::rect pos = elem->getAbsolutePosition(); - if (!lastElemPos || *lastElemPos != pos) + if (!SDL_IsTextInputActive() || lastElemPos != pos) { lastElemPos = pos; SDL_Rect rect; @@ -238,7 +238,6 @@ void CIrrDeviceSDL::resetReceiveTextInputEvents() { } else { - lastElemPos.reset(); SDL_StopTextInput(); } } diff --git a/source/Irrlicht/CIrrDeviceSDL.h b/source/Irrlicht/CIrrDeviceSDL.h index 014042ba..ebd8e032 100644 --- a/source/Irrlicht/CIrrDeviceSDL.h +++ b/source/Irrlicht/CIrrDeviceSDL.h @@ -24,7 +24,6 @@ #include #include -#include namespace irr { @@ -304,7 +303,7 @@ namespace irr bool Resizable; - std::optional> lastElemPos; + core::rect lastElemPos; struct SKeyMap {