浏览代码

Fixed event spam caused by repeated calls to IME_SetTextInputRect()

Sam Lantinga 1 年之前
父节点
当前提交
e324c7d692
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/video/windows/SDL_windowskeyboard.c

+ 4 - 0
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);