Fix #264: Crash before calling SDL_SetTextInputRect with no window focused

This commit is contained in:
Jonathan G Rennison
2021-05-30 07:38:37 +01:00
parent 62e3bfd684
commit bf87578173
2 changed files with 9 additions and 1 deletions

View File

@@ -50,6 +50,7 @@ static std::string _editing_text;
static void SetTextInputRect();
bool IsWindowFocused();
Point GetFocusedWindowCaret();
Point GetFocusedWindowTopLeft();
bool FocusedWindowIsConsole();
@@ -432,6 +433,8 @@ bool VideoDriver_SDL_Base::ClaimMousePointer()
static void SetTextInputRect()
{
if (!IsWindowFocused()) return;
SDL_Rect winrect;
Point caret = GetFocusedWindowCaret();
Point win = GetFocusedWindowTopLeft();