[Ttssh2-commit] [7458] ticket #39007

scmno****@osdn***** scmno****@osdn*****
2019年 3月 3日 (日) 16:40:17 JST


Revision: 7458
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/7458
Author:   zmatsuo
Date:     2019-03-03 16:40:17 +0900 (Sun, 03 Mar 2019)
Log Message:
-----------
ticket #39007
キャレットON時IMEに候補ウィンドウ位置を通知するようにした(従来と同様。ただし、IME ON時のみ)
候補ウィンドウ位置設定時に候補ウィンドウのフォントの設定を行わないようにした。

Ticket Links:
------------
    http://sourceforge.jp/projects/ttssh2/tracker/detail/39007

Modified Paths:
--------------
    trunk/teraterm/teraterm/ttime.c
    trunk/teraterm/teraterm/ttime.h
    trunk/teraterm/teraterm/vtdisp.c

-------------- next part --------------
Modified: trunk/teraterm/teraterm/ttime.c
===================================================================
--- trunk/teraterm/teraterm/ttime.c	2019-03-02 16:19:00 UTC (rev 7457)
+++ trunk/teraterm/teraterm/ttime.c	2019-03-03 07:40:17 UTC (rev 7458)
@@ -186,15 +186,20 @@
   else
     cf.dwStyle = CFS_DEFAULT;
   (*PImmSetCompositionWindow)(hIMC,&cf);
-
-  // Set font for the conversion window
-  (*PImmSetCompositionFont)(hIMC,&lfIME);
   (*PImmReleaseContext)(HVTWin,hIMC);
 }
 
-void SetConversionLogFont(PLOGFONT lf)
+void SetConversionLogFont(HWND HWin, PLOGFONT lf)
 {
+  HIMC	hIMC;
+  if (HIMEDLL == NULL) return;
+
   memcpy(&lfIME,lf,sizeof(LOGFONT));
+
+  hIMC = (*PImmGetContext)(HVTWin);
+  // Set font for the conversion window
+  (*PImmSetCompositionFont)(hIMC,&lfIME);
+  (*PImmReleaseContext)(HVTWin,hIMC);
 }
 
 HGLOBAL GetConvString(UINT wParam, LPARAM lParam)

Modified: trunk/teraterm/teraterm/ttime.h
===================================================================
--- trunk/teraterm/teraterm/ttime.h	2019-03-02 16:19:00 UTC (rev 7457)
+++ trunk/teraterm/teraterm/ttime.h	2019-03-03 07:40:17 UTC (rev 7458)
@@ -38,7 +38,7 @@
 void FreeIME();
 BOOL CanUseIME();
 void SetConversionWindow(HWND HWin, int X, int Y);
-void SetConversionLogFont(PLOGFONT lf);
+void SetConversionLogFont(HWND HWin, PLOGFONT lf);
 BOOL GetIMEOpenStatus(void);
 void SetIMEOpenStatus(BOOL stat);
 

Modified: trunk/teraterm/teraterm/vtdisp.c
===================================================================
--- trunk/teraterm/teraterm/vtdisp.c	2019-03-02 16:19:00 UTC (rev 7457)
+++ trunk/teraterm/teraterm/vtdisp.c	2019-03-03 07:40:17 UTC (rev 7458)
@@ -1981,7 +1981,7 @@
   VTFont[0] = CreateFontIndirect(&VTlf);
 
   /* set IME font */
-  SetConversionLogFont(&VTlf);
+  SetConversionLogFont(HVTWin, &VTlf);
 
   TmpDC = GetDC(HVTWin);
 
@@ -2063,7 +2063,7 @@
 		if (ts.UseIME>0)
 		{
 			if (ts.IMEInline>0)
-				SetConversionLogFont(&VTlf);
+				SetConversionLogFont(HVTWin, &VTlf);
 			else
 				SetConversionWindow(HVTWin,-1,0);
 		}
@@ -2219,6 +2219,15 @@
 
 		CaretX = (CursorX-WinOrgX)*FontWidth;
 		CaretY = (CursorY-WinOrgY)*FontHeight;
+
+		if (IMEstat) {
+			// IME ON \x82̏ꍇ\x82݂̂̏\x88\x97\x9D
+			// \x95\xB6\x8E\x9A\x93\xFC\x97͂\xF0\x8AJ\x8En(\x95ϊ\xB7\x83E\x83B\x83\x93\x83h\x83E\x82\xAA\x95\\x8E\xA6\x82\xB3\x82\xEA\x82Ă\xA2\x82\xE9)\x8F\xF3\x91Ԃ\xC5
+			// \x83z\x83X\x83g\x82\xA9\x82\xE7\x82̃G\x83R\x81[\x82\xF0\x8E\xF3\x90M\x82\xB5\x82\xC4caret\x88ʒu\x82\xAA\x95ω\xBB\x82\xB5\x82\xBD\x8Fꍇ\x81A
+			// \x95ϊ\xB7\x83E\x83B\x83\x93\x83h\x83E\x82̈ʒu\x82\xF0\x8DX\x90V\x82\xB7\x82\xE9\x95K\x97v\x82\xAA\x82\xA0\x82\xE9
+			SetConversionWindow(HVTWin,CaretX,CaretY);
+		}
+
 		if (ts.CursorShape!=IdVCur) {
 			if (ts.CursorShape==IdHCur) {
 				CaretY = CaretY+FontHeight-CurWidth;


Ttssh2-commit メーリングリストの案内