Alexandre Julliard : winemac: Only register the IME class when needed.

Alexandre Julliard julliard at winehq.org
Fri Jan 10 14:44:53 CST 2014


Module: wine
Branch: stable
Commit: ee573a246db74a6d464d9a14637b96ec1d6c1966
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ee573a246db74a6d464d9a14637b96ec1d6c1966

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Oct 21 11:31:10 2013 +0200

winemac: Only register the IME class when needed.

(cherry picked from commit 5435dad997cee166f47ca7681b61b4472841bab5)

---

 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 bed094d..8279148 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 0c35ce1..98aa600 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 d27ce94..0f4b056 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;
 }
@@ -299,7 +299,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();




More information about the wine-cvs mailing list