SDL: Fixed event spam caused by repeated calls to IME_SetTextInputRect()

From e324c7d6920be431b4324ae6bcc2d15f4cd808cc Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Thu, 27 Jun 2024 22:35:19 -0700
Subject: [PATCH] Fixed event spam caused by repeated calls to
 IME_SetTextInputRect()

---
 src/video/windows/SDL_windowskeyboard.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c
index b74f92b374ee6..76973f0079de8 100644
--- a/src/video/windows/SDL_windowskeyboard.c
+++ b/src/video/windows/SDL_windowskeyboard.c
@@ -696,6 +696,10 @@ static void IME_SetTextInputRect(SDL_VideoData *videodata, const SDL_Rect *rect)
 {
     HIMC himc = 0;
 
+    if (SDL_memcmp(rect, &videodata->ime_rect, sizeof(*rect)) == 0) {
+        return;
+    }
+
     videodata->ime_rect = *rect;
 
     himc = ImmGetContext(videodata->ime_hwnd_current);