| Summary: | IME_SendEditingEvent() always calls SDL_SendEditingText() with incorrect arguments | ||
|---|---|---|---|
| Product: | SDL | Reporter: | tamo <ttakah+sdl> |
| Component: | events | Assignee: | Sam Lantinga <slouken> |
| Status: | NEW --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | major | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | All | ||
| OS: | Windows 10 | ||
| Attachments: |
not "end" but "length", and fix "start" and "length"
fix scope fix it with correct indent fix header and indent picture of IME composition |
||
|
Description
tamo
2019-09-01 19:32:58 UTC
Oops, "end" should be "len+wcslen(reading)".
> SDL_SendEditingText(s, len, len + (int)SDL_wcslen(videodata->ime_readingstring));
No, reading events/SDL_keyboard.c and others, the last arg is not "end" but "length." So events/SDL_keyboard.c is incorrect, too. Created attachment 3940 [details]
not "end" but "length", and fix "start" and "length"
Fix both header and code
Created attachment 3941 [details]
fix scope
the previous patch didn't build
Created attachment 3942 [details]
fix it with correct indent
fix indent
Created attachment 3943 [details]
fix header and indent
The header is incorrect.
"readingstring" is just a pronunciation, not selection.
In fact, Japanese IMEs hardly use readingstring. (I've never imagined that.)
Created attachment 3944 [details] picture of IME composition What I really wanted are, things like GetCompositionTargetRange and GetImeTextSpans in https://github.com/chromium/chromium/blob/master/ui/base/ime/win/imm32_manager.cc code. So, at least two numbers should be given to the event: target_start and target_end. See the attached picure. The red range is the "target" and the yellow spans are "clauses" in IME terms. The target range is necessary for Japanese. (That's what I thought "readingstring" was.) Anyway, that's another issue. |