Re: user32: Update the edit control when the IME composition string is emptied.
Hello, Byeong-Sik Jeon wrote:
I tested for this patch with the patched Xlib(XFilterEvent deadlock problem with XInitThreads). https://bugs.freedesktop.org/show_bug.cgi?id=1182 https://bugs.freedesktop.org/attachment.cgi?id=4874
Changelog: Update the edit control when the "IME composition string" is emptied. --- dlls/user/edit.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-)
------------------------------------------------------------------------
diff --git a/dlls/user/edit.c b/dlls/user/edit.c index 5b38b68..c0410f1 100644 --- a/dlls/user/edit.c +++ b/dlls/user/edit.c @@ -5335,7 +5335,7 @@ static void EDIT_GetCompositionStr(HWND
dwBufLen = ImmGetCompositionStringW(hIMC, GCS_COMPSTR, NULL, 0);
- if (dwBufLen <= 0) + if (dwBufLen < 0) { ImmReleaseContext(hwnd, hIMC); return; @@ -5349,7 +5349,8 @@ static void EDIT_GetCompositionStr(HWND return; }
- ImmGetCompositionStringW(hIMC, GCS_COMPSTR, lpCompStr, dwBufLen); + if (dwBufLen) + ImmGetCompositionStringW(hIMC, GCS_COMPSTR, lpCompStr, dwBufLen); lpCompStr[dwBufLen/sizeof(WCHAR)] = 0;
if (CompFlag & GCS_COMPATTR) @@ -5396,7 +5397,8 @@ static void EDIT_GetCompositionStr(HWND es->selection_start = es->composition_start; es->selection_end = es->selection_start + es->composition_len;
- HeapFree(GetProcessHeap(),0,lpCompStrAttr); + if (lpCompStrAttr) + HeapFree(GetProcessHeap(),0,lpCompStrAttr); This change is not needed as HeapFree'ing NULL isn't an error.
HeapFree(GetProcessHeap(),0,lpCompStr); ImmReleaseContext(hwnd,hIMC); }
bye michael -- Michael Stefaniuc Tel.: +49-711-96437-199 Sr. Network Engineer Fax.: +49-711-96437-111 Red Hat GmbH Email: mstefani(a)redhat.com Hauptstaetterstr. 58 http://www.redhat.de/ D-70178 Stuttgart
participants (1)
-
Michael Stefaniuc