Module: wine Branch: master Commit: 428120441bd39f9311d75aa6ebad97d342837f45 URL: https://gitlab.winehq.org/wine/wine/-/commit/428120441bd39f9311d75aa6ebad97d...
Author: Rémi Bernon rbernon@codeweavers.com Date: Tue Jul 25 11:35:19 2023 +0200
imm32: Hide the composition window if the string is empty.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55258
---
dlls/imm32/ime.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/dlls/imm32/ime.c b/dlls/imm32/ime.c index 0470f3b6d6c..60672b366ab 100644 --- a/dlls/imm32/ime.c +++ b/dlls/imm32/ime.c @@ -98,6 +98,8 @@ static void input_context_set_comp_str( INPUTCONTEXT *ctx, const WCHAR *str, UIN UINT size; BYTE *dst;
+ TRACE( "ctx %p, str %s\n", ctx, debugstr_wn( str, len ) ); + size = sizeof(*compstr); size += len * sizeof(WCHAR); /* GCS_COMPSTR */ size += len; /* GCS_COMPSTRATTR */ @@ -310,20 +312,17 @@ static void ime_ui_paint( HIMC himc, HWND hwnd )
static void ime_ui_update_window( INPUTCONTEXT *ctx, HWND hwnd ) { - COMPOSITIONSTRING *string; - - if (ctx->hCompStr) string = ImmLockIMCC( ctx->hCompStr ); - else string = NULL; + WCHAR *str; + UINT len;
- if (!string || string->dwCompStrLen == 0) + if (!(str = input_context_get_comp_str( ctx, FALSE, &len )) || !*str) ShowWindow( hwnd, SW_HIDE ); else { ShowWindow( hwnd, SW_SHOWNOACTIVATE ); RedrawWindow( hwnd, NULL, NULL, RDW_ERASENOW | RDW_INVALIDATE ); } - - if (string) ImmUnlockIMCC( ctx->hCompStr ); + free( str );
ctx->hWnd = GetFocus(); }