Use SDL's API function to check for TextInputActive state

This commit is contained in:
y5nw 2024-02-08 16:59:56 +01:00
parent 526abaccbe
commit 889890810e
2 changed files with 2 additions and 4 deletions

View File

@ -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<s32> 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();
}
}

View File

@ -24,7 +24,6 @@
#include <SDL_syswm.h>
#include <memory>
#include <optional>
namespace irr
{
@ -304,7 +303,7 @@ namespace irr
bool Resizable;
std::optional<core::rect<s32>> lastElemPos;
core::rect<s32> lastElemPos;
struct SKeyMap
{