Skip to content

Commit

Permalink
Don't move the cursor to the end of the selected candidate
Browse files Browse the repository at this point in the history
We might have legitimately moved the cursor to the beginning.

Fixes libsdl-org#9761
  • Loading branch information
slouken committed Jun 25, 2024
1 parent 6dfa688 commit 2b419a1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/video/windows/SDL_windowskeyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,7 @@ static void IME_GetCompositionString(SDL_VideoData *videodata, HIMC himc, DWORD

videodata->ime_composition[length] = 0;

#if 0 // At least with the Chinese IME, it's possible to move the cursor to the beginning of the selection, see https://github.com/libsdl-org/SDL/issues/9761 for details
// Get the correct caret position if we've selected a candidate from the candidate window
if (videodata->ime_cursor == 0 && length > 0) {
Sint32 start = 0;
Expand Down Expand Up @@ -871,6 +872,7 @@ static void IME_GetCompositionString(SDL_VideoData *videodata, HIMC himc, DWORD

videodata->ime_cursor = end;
}
#endif // 0
}

static void IME_SendInputEvent(SDL_VideoData *videodata)
Expand Down

0 comments on commit 2b419a1

Please sign in to comment.