Module: wine Branch: master Commit: 7cc272cdefaa19ff2b6f0d2e961abdd840bce204 URL: http://source.winehq.org/git/wine.git/?a=commit;h=7cc272cdefaa19ff2b6f0d2e96...
Author: Alexandre Julliard julliard@winehq.org Date: Mon Oct 21 22:05:34 2013 +0200
winex11: Use an init once function to register IME classes.
---
dlls/winex11.drv/ime.c | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/dlls/winex11.drv/ime.c b/dlls/winex11.drv/ime.c index aa6c7dd..cd40f77 100644 --- a/dlls/winex11.drv/ime.c +++ b/dlls/winex11.drv/ime.c @@ -122,14 +122,10 @@ static BOOL UnlockRealIMC(HIMC hIMC) return FALSE; }
-static void IME_RegisterClasses(void) +static BOOL WINAPI register_classes( INIT_ONCE *once, void *param, void **context ) { - static BOOL done = FALSE; WNDCLASSW wndClass;
- if (done) return; - done = TRUE; - ZeroMemory(&wndClass, sizeof(WNDCLASSW)); wndClass.style = CS_GLOBALCLASS | CS_IME | CS_HREDRAW | CS_VREDRAW; wndClass.lpfnWndProc = IME_WindowProc; @@ -151,6 +147,7 @@ static void IME_RegisterClasses(void) WM_MSIME_RECONVERT = RegisterWindowMessageA("MSIMEReconvert"); WM_MSIME_QUERYPOSITION = RegisterWindowMessageA("MSIMEQueryPosition"); WM_MSIME_DOCUMENTFEED = RegisterWindowMessageA("MSIMEDocumentFeed"); + return TRUE; }
static HIMCC ImeCreateBlankCompStr(void) @@ -561,8 +558,10 @@ static void IME_AddToSelected(HIMC hIMC) BOOL WINAPI ImeInquire(LPIMEINFO lpIMEInfo, LPWSTR lpszUIClass, LPCWSTR lpszOption) { + static INIT_ONCE init_once = INIT_ONCE_STATIC_INIT; + TRACE("\n"); - IME_RegisterClasses(); + InitOnceExecuteOnce( &init_once, register_classes, NULL, NULL ); lpIMEInfo->dwPrivateDataSize = sizeof (IMEPRIVATE); lpIMEInfo->fdwProperty = IME_PROP_UNICODE | IME_PROP_AT_CARET; lpIMEInfo->fdwConversionCaps = IME_CMODE_NATIVE;