[PATCH 1/2] imm32 : Make an interface to disable input method in ImmAssociateContext

Dongwan Kim kdw6485 at gmail.com
Wed Jun 23 22:02:19 CDT 2021


When ImmAssociateContext(hwnd, 0) is called, imm should be disabled.
On Debian using uim or fcitx for korean, a program cannot receive
KeyPress(VK_HANGUL) because the input method consumes the key.
We should change input context to disable it in ImmAssociateContext.

Signed-off-by: Dongwan Kim <kdw6485 at gmail.com>
---
 dlls/imm32/imm.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c
index 9d2a09f22be..9f9f898db9e 100644
--- a/dlls/imm32/imm.c
+++ b/dlls/imm32/imm.c
@@ -111,6 +111,7 @@ static CRITICAL_SECTION_DEBUG critsect_debug =
 };
 static CRITICAL_SECTION threaddata_cs = { &critsect_debug, -1, 0, 0, 0, 0 };
 static BOOL disable_ime;
+static HIMC ( *wine_associate_input_context)(HWND, HIMC);
 
 static inline BOOL is_himc_ime_unicode(const InputContextData *data)
 {
@@ -598,6 +599,13 @@ HIMC WINAPI ImmAssociateContext(HWND hWnd, HIMC hIMC)
         }
     }
 
+    if(!wine_associate_input_context)
+    {
+		HMODULE h = load_graphics_driver();
+		wine_associate_input_context = (LPVOID)GetProcAddress(h, "wine_associate_input_context");
+		FreeLibrary(h);
+    }
+	wine_associate_input_context(hWnd, hIMC);
     if (!hIMC)
         return old;
 
-- 
2.30.2




More information about the wine-devel mailing list