Commit 3b4aa166 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

imm32: Rewrite ImmInternalPostIMEMessage helper as imc_post_message.

parent f6cf1d44
...@@ -734,14 +734,11 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpReserved) ...@@ -734,14 +734,11 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpReserved)
return TRUE; return TRUE;
} }
/* for posting messages as the IME */ static void imc_post_message( struct imc *imc, TRANSMSG *message )
static void ImmInternalPostIMEMessage( struct imc *data, UINT msg, WPARAM wParam, LPARAM lParam )
{ {
HWND target = GetFocus(); HWND target;
if (!target) if (!(target = GetFocus()) && !(target = imc->IMC.hWnd)) return;
PostMessageW(data->IMC.hWnd,msg,wParam,lParam); PostMessageW( target, message->message, message->wParam, message->lParam );
else
PostMessageW(target, msg, wParam, lParam);
} }
static void imc_send_message( struct imc *imc, TRANSMSG *message ) static void imc_send_message( struct imc *imc, TRANSMSG *message )
...@@ -3031,7 +3028,7 @@ BOOL WINAPI ImmTranslateMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lKeyD ...@@ -3031,7 +3028,7 @@ BOOL WINAPI ImmTranslateMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lKeyD
BYTE state[256]; BYTE state[256];
UINT scancode; UINT scancode;
TRANSMSGLIST *list = NULL; TRANSMSGLIST *list = NULL;
UINT msg_count; UINT msg_count, i;
UINT uVirtKey; UINT uVirtKey;
static const DWORD list_count = 10; static const DWORD list_count = 10;
...@@ -3063,13 +3060,7 @@ BOOL WINAPI ImmTranslateMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lKeyD ...@@ -3063,13 +3060,7 @@ BOOL WINAPI ImmTranslateMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lKeyD
msg_count = ime->pImeToAsciiEx( uVirtKey, scancode, state, list, 0, imc ); msg_count = ime->pImeToAsciiEx( uVirtKey, scancode, state, list, 0, imc );
TRACE("%i messages generated\n",msg_count); TRACE("%i messages generated\n",msg_count);
if (msg_count && msg_count <= list_count) if (msg_count && msg_count <= list_count)
{ for (i = 0; i < msg_count; i++) imc_post_message( data, list->TransMsg + i );
UINT i;
LPTRANSMSG msgs = list->TransMsg;
for (i = 0; i < msg_count; i++)
ImmInternalPostIMEMessage(data, msgs[i].message, msgs[i].wParam, msgs[i].lParam);
}
else if (msg_count > list_count) else if (msg_count > list_count)
ImmGenerateMessage(imc); ImmGenerateMessage(imc);
......
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