From: Byeongsik Jeon bsjeon@hanmail.net
--- dlls/winemac.drv/cocoa_window.m | 3 ++- dlls/winemac.drv/event.c | 4 +++- dlls/winemac.drv/macdrv_cocoa.h | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m index 4ef9c305b61..71d5c96aa1a 100644 --- a/dlls/winemac.drv/cocoa_window.m +++ b/dlls/winemac.drv/cocoa_window.m @@ -867,7 +867,8 @@ - (void) setMarkedText:(id)string selectedRange:(NSRange)selectedRange replaceme event->im_set_text.himc = [window himc]; event->im_set_text.text = (CFStringRef)[[markedText string] copy]; event->im_set_text.complete = FALSE; - event->im_set_text.cursor_pos = markedTextSelection.location + markedTextSelection.length; + event->im_set_text.cursor_begin = markedTextSelection.location; + event->im_set_text.cursor_end = markedTextSelection.location + markedTextSelection.length;
[[window queue] postEvent:event];
diff --git a/dlls/winemac.drv/event.c b/dlls/winemac.drv/event.c index 20a791ac48a..82bf829d1a0 100644 --- a/dlls/winemac.drv/event.c +++ b/dlls/winemac.drv/event.c @@ -176,7 +176,9 @@ static void macdrv_im_set_text(const macdrv_event *event) }
if (event->im_set_text.complete) post_ime_update(hwnd, -1, NULL, text); - else post_ime_update(hwnd, event->im_set_text.cursor_pos, text, NULL); + else post_ime_update(hwnd, + MAKELONG(event->im_set_text.cursor_begin, event->im_set_text.cursor_end), + text, NULL);
free(text); } diff --git a/dlls/winemac.drv/macdrv_cocoa.h b/dlls/winemac.drv/macdrv_cocoa.h index 917c8103d41..9807d4e53fc 100644 --- a/dlls/winemac.drv/macdrv_cocoa.h +++ b/dlls/winemac.drv/macdrv_cocoa.h @@ -365,7 +365,8 @@ extern int macdrv_set_display_mode(const struct macdrv_display* display, struct { void *himc; CFStringRef text; /* new text or NULL if just completing existing text */ - unsigned int cursor_pos; + unsigned int cursor_begin; + unsigned int cursor_end; unsigned int complete; /* is completing text? */ } im_set_text; struct {