Commit ede59b0c authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

imm32: If composition string is reduced to 0 characters hide composition window.

parent a72e1820
...@@ -74,7 +74,7 @@ static UINT WM_MSIME_DOCUMENTFEED; ...@@ -74,7 +74,7 @@ static UINT WM_MSIME_DOCUMENTFEED;
*/ */
static LRESULT WINAPI IME_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, static LRESULT WINAPI IME_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam,
LPARAM lParam); LPARAM lParam);
static void UpdateDataInDefaultIMEWindow(HWND hwnd); static void UpdateDataInDefaultIMEWindow(HWND hwnd, BOOL showable);
static void ImmInternalPostIMEMessage(UINT, WPARAM, LPARAM); static void ImmInternalPostIMEMessage(UINT, WPARAM, LPARAM);
static void ImmInternalSetOpenStatus(BOOL fOpen); static void ImmInternalSetOpenStatus(BOOL fOpen);
static HIMCC updateResultStr(HIMCC old, LPWSTR resultstr, DWORD len); static HIMCC updateResultStr(HIMCC old, LPWSTR resultstr, DWORD len);
...@@ -1672,7 +1672,7 @@ BOOL WINAPI ImmSetCompositionStringW( ...@@ -1672,7 +1672,7 @@ BOOL WINAPI ImmSetCompositionStringW(
} }
} }
UpdateDataInDefaultIMEWindow(hwndDefault); UpdateDataInDefaultIMEWindow(hwndDefault,FALSE);
ImmInternalPostIMEMessage(WM_IME_COMPOSITION, wParam, flags); ImmInternalPostIMEMessage(WM_IME_COMPOSITION, wParam, flags);
...@@ -2033,9 +2033,24 @@ static void PaintDefaultIMEWnd(HWND hwnd) ...@@ -2033,9 +2033,24 @@ static void PaintDefaultIMEWnd(HWND hwnd)
EndPaint(hwnd,&ps); 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); 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, ...@@ -2075,7 +2090,7 @@ static LRESULT WINAPI IME_WindowProc(HWND hwnd, UINT msg, WPARAM wParam,
if (lParam & GCS_RESULTSTR) if (lParam & GCS_RESULTSTR)
IMM_PostResult(root_context); IMM_PostResult(root_context);
else else
UpdateDataInDefaultIMEWindow(hwnd); UpdateDataInDefaultIMEWindow(hwnd,TRUE);
break; break;
case WM_IME_STARTCOMPOSITION: case WM_IME_STARTCOMPOSITION:
TRACE("IME message %s, 0x%x, 0x%x\n", TRACE("IME message %s, 0x%x, 0x%x\n",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment