To: vim-dev@vim.org Subject: Patch 6.1.345 (extra) Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.345 (extra) Problem: Win32: 'imdisable' doesn't work. Solution: Make 'imdisable' work. (Yasuhiro Matsumoto) Files: src/gui_w32.c *** ../vim61.344/src/gui_w32.c Sun Feb 16 22:45:23 2003 --- src/gui_w32.c Thu Feb 20 18:52:11 2003 *************** *** 244,249 **** --- 244,250 ---- LONG (WINAPI *pImmGetCompositionStringA)(HIMC, DWORD, LPVOID, DWORD); LONG (WINAPI *pImmGetCompositionStringW)(HIMC, DWORD, LPVOID, DWORD); HIMC (WINAPI *pImmGetContext)(HWND); + HIMC (WINAPI *pImmAssociateContext)(HWND, HIMC); BOOL (WINAPI *pImmReleaseContext)(HWND, HIMC); BOOL (WINAPI *pImmGetOpenStatus)(HIMC); BOOL (WINAPI *pImmSetOpenStatus)(HIMC, BOOL); *************** *** 256,261 **** --- 257,263 ---- # define pImmGetCompositionStringA ImmGetCompositionStringA # define pImmGetCompositionStringW ImmGetCompositionStringW # define pImmGetContext ImmGetContext + # define pImmAssociateContext ImmAssociateContext # define pImmReleaseContext ImmReleaseContext # define pImmGetOpenStatus ImmGetOpenStatus # define pImmSetOpenStatus ImmSetOpenStatus *************** *** 1472,1480 **** --- 1474,1498 ---- im_set_active(int active) { HIMC hImc; + static HIMC hImcOld = NULL; if (p_imdisable) + { + if (hImcOld == NULL) + { + hImcOld = pImmGetContext(s_hwnd); + if (hImcOld) + pImmAssociateContext(s_hwnd, NULL); + } active = FALSE; + } + else + if (hImcOld != NULL) + { + pImmAssociateContext(s_hwnd, hImcOld); + hImcOld = NULL; + } + if (pImmGetContext && (hImc = pImmGetContext(s_hwnd))) { pImmSetOpenStatus(hImc, active); *************** *** 3338,3343 **** --- 3358,3366 ---- if ((*((FARPROC*)&pImmGetContext) = GetProcAddress(hLibImm, "ImmGetContext"))) nImmFunc++; + if ((*((FARPROC*)&pImmAssociateContext) + = GetProcAddress(hLibImm, "ImmAssociateContext"))) + nImmFunc++; if ((*((FARPROC*)&pImmReleaseContext) = GetProcAddress(hLibImm, "ImmReleaseContext"))) nImmFunc++; *************** *** 3360,3366 **** = GetProcAddress(hLibImm, "ImmGetConversionStatus"))) nImmFunc++; ! if (nImmFunc != 10) { FreeLibrary(hLibImm); hLibImm = NULL; --- 3383,3389 ---- = GetProcAddress(hLibImm, "ImmGetConversionStatus"))) nImmFunc++; ! if (nImmFunc != 11) { FreeLibrary(hLibImm); hLibImm = NULL; *** ../vim61.344/src/version.c Thu Feb 20 21:19:02 2003 --- src/version.c Thu Feb 20 21:27:07 2003 *************** *** 608,609 **** --- 612,615 ---- { /* Add new patch number below this line */ + /**/ + 345, /**/ -- Overflow on /dev/null, please empty the bit bucket. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///