Module: wine Branch: master Commit: ede59b0c05f268c10bea4f5ff03cd980c1d2f5d7 URL: http://source.winehq.org/git/wine.git/?a=commit;h=ede59b0c05f268c10bea4f5ff0...
Author: Aric Stewart aric@codeweavers.com Date: Mon Aug 27 18:08:38 2007 +0900
imm32: If composition string is reduced to 0 characters hide composition window.
---
dlls/imm32/imm.c | 23 +++++++++++++++++++---- 1 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c index 26d0b51..ac5c6eb 100644 --- a/dlls/imm32/imm.c +++ b/dlls/imm32/imm.c @@ -74,7 +74,7 @@ static UINT WM_MSIME_DOCUMENTFEED; */ static LRESULT WINAPI IME_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); -static void UpdateDataInDefaultIMEWindow(HWND hwnd); +static void UpdateDataInDefaultIMEWindow(HWND hwnd, BOOL showable); static void ImmInternalPostIMEMessage(UINT, WPARAM, LPARAM); static void ImmInternalSetOpenStatus(BOOL fOpen); static HIMCC updateResultStr(HIMCC old, LPWSTR resultstr, DWORD len); @@ -1672,7 +1672,7 @@ BOOL WINAPI ImmSetCompositionStringW( } }
- UpdateDataInDefaultIMEWindow(hwndDefault); + UpdateDataInDefaultIMEWindow(hwndDefault,FALSE);
ImmInternalPostIMEMessage(WM_IME_COMPOSITION, wParam, flags);
@@ -2033,9 +2033,24 @@ static void PaintDefaultIMEWnd(HWND hwnd) EndPaint(hwnd,&ps); }
-static void UpdateDataInDefaultIMEWindow(HWND hwnd) +static void UpdateDataInDefaultIMEWindow(HWND hwnd, BOOL showable) { + LPCOMPOSITIONSTRING compstr; + + if (root_context->IMC.hCompStr) + compstr = ImmLockIMCC(root_context->IMC.hCompStr); + else + compstr = NULL; + + if (compstr == NULL || compstr->dwCompStrLen == 0) + ShowWindow(hwndDefault,SW_HIDE); + else if (showable) + ShowWindow(hwndDefault,SW_SHOWNOACTIVATE); + RedrawWindow(hwnd,NULL,NULL,RDW_ERASENOW|RDW_INVALIDATE); + + if (compstr != NULL) + ImmUnlockIMCC(root_context->IMC.hCompStr); }
/* @@ -2075,7 +2090,7 @@ static LRESULT WINAPI IME_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, if (lParam & GCS_RESULTSTR) IMM_PostResult(root_context); else - UpdateDataInDefaultIMEWindow(hwnd); + UpdateDataInDefaultIMEWindow(hwnd,TRUE); break; case WM_IME_STARTCOMPOSITION: TRACE("IME message %s, 0x%x, 0x%x\n",