Module: wine Branch: master Commit: 5435dad997cee166f47ca7681b61b4472841bab5 URL: http://source.winehq.org/git/wine.git/?a=commit;h=5435dad997cee166f47ca7681b...
Author: Alexandre Julliard julliard@winehq.org Date: Mon Oct 21 11:31:10 2013 +0200
winemac: Only register the IME class when needed.
---
dlls/winemac.drv/ime.c | 1 + dlls/winemac.drv/macdrv.h | 1 + dlls/winemac.drv/macdrv_main.c | 7 ++++--- 3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/dlls/winemac.drv/ime.c b/dlls/winemac.drv/ime.c index 5fca8fe..53a10f3 100644 --- a/dlls/winemac.drv/ime.c +++ b/dlls/winemac.drv/ime.c @@ -566,6 +566,7 @@ static void UpdateDataInDefaultIMEWindow(HIMC hIMC, HWND hwnd, BOOL showable) BOOL WINAPI ImeInquire(LPIMEINFO lpIMEInfo, LPWSTR lpszUIClass, LPCWSTR lpszOption) { TRACE("\n"); + IME_RegisterClasses( macdrv_module ); lpIMEInfo->dwPrivateDataSize = sizeof(IMEPRIVATE); lpIMEInfo->fdwProperty = IME_PROP_UNICODE | IME_PROP_AT_CARET; lpIMEInfo->fdwConversionCaps = IME_CMODE_NATIVE; diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h index 860d29d..24c3f65 100644 --- a/dlls/winemac.drv/macdrv.h +++ b/dlls/winemac.drv/macdrv.h @@ -38,6 +38,7 @@ extern BOOL skip_single_buffer_flushes DECLSPEC_HIDDEN; extern BOOL allow_vsync DECLSPEC_HIDDEN; extern BOOL allow_set_gamma DECLSPEC_HIDDEN; +extern HMODULE macdrv_module DECLSPEC_HIDDEN;
extern const char* debugstr_cf(CFTypeRef t) DECLSPEC_HIDDEN; diff --git a/dlls/winemac.drv/macdrv_main.c b/dlls/winemac.drv/macdrv_main.c index 5317c8b..b86c8ae 100644 --- a/dlls/winemac.drv/macdrv_main.c +++ b/dlls/winemac.drv/macdrv_main.c @@ -52,6 +52,7 @@ BOOL allow_vsync = TRUE; BOOL allow_set_gamma = TRUE; int left_option_is_alt = 0; int right_option_is_alt = 0; +HMODULE macdrv_module = 0;
/************************************************************************** @@ -183,7 +184,7 @@ static void setup_options(void) /*********************************************************************** * process_attach */ -static BOOL process_attach( HINSTANCE instance ) +static BOOL process_attach(void) { SessionAttributeBits attributes; OSStatus status; @@ -205,7 +206,6 @@ static BOOL process_attach( HINSTANCE instance )
set_app_icon(); macdrv_clipboard_process_attach(); - IME_RegisterClasses( instance );
return TRUE; } @@ -301,7 +301,8 @@ BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved) switch(reason) { case DLL_PROCESS_ATTACH: - ret = process_attach( hinst ); + macdrv_module = hinst; + ret = process_attach(); break; case DLL_THREAD_DETACH: thread_detach();