[Ttssh2-commit] [7459] IMEの候補ウィンドウの位置設定を最小限にした

scmno****@osdn***** scmno****@osdn*****
2019年 3月 4日 (月) 01:03:33 JST


Revision: 7459
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/7459
Author:   zmatsuo
Date:     2019-03-04 01:03:33 +0900 (Mon, 04 Mar 2019)
Log Message:
-----------
IMEの候補ウィンドウの位置設定を最小限にした

Modified Paths:
--------------
    trunk/doc/ja/html/about/history.html
    trunk/teraterm/teraterm/vtdisp.c
    trunk/teraterm/teraterm/vtdisp.h
    trunk/teraterm/teraterm/vtwin.cpp
    trunk/teraterm/teraterm/vtwin.h

-------------- next part --------------
Modified: trunk/doc/ja/html/about/history.html
===================================================================
--- trunk/doc/ja/html/about/history.html	2019-03-03 07:40:17 UTC (rev 7458)
+++ trunk/doc/ja/html/about/history.html	2019-03-03 16:03:33 UTC (rev 7459)
@@ -33,6 +33,12 @@
 
 <h3 id="teraterm_4.103">2019.xx.xx (Ver 4.103)</h3>
 <ul class="history">
+  <li>\x83o\x83O\x8FC\x90\xB3
+    <ul>
+      <li>IME\x82̕ϊ\xB7\x8C\xF3\x95\xE2\x83E\x83B\x83\x93\x83h\x83E\x82̕\\x8E\xA6\x88ʒu\x82\xF0\x83J\x81[\x83\\x83\x8B\x88ʒu\x82ɒǏ]\x82\xB7\x82\xE9\x82悤\x82ɂ\xB5\x82\xBD\x81B(4.102\x82̍\x82\x91\xAC\x89\xBB\x82̉e\x8B\xBF)</li>
+    </ul>
+  </li>
+
   <li>\x82\xBB\x82̑\xBC
     <ul>
       <li><a href="#ttssh_2.89">TTSSH(2.89)</a>\x82֍\xB7\x82\xB5\x91ւ\xA6\x82\xBD\x81B</li>

Modified: trunk/teraterm/teraterm/vtdisp.c
===================================================================
--- trunk/teraterm/teraterm/vtdisp.c	2019-03-03 07:40:17 UTC (rev 7458)
+++ trunk/teraterm/teraterm/vtdisp.c	2019-03-03 16:03:33 UTC (rev 7459)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 1994-1998 T. Teranishi
- * (C) 2005-2018 TeraTerm Project
+ * (C) 2005-2019 TeraTerm Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -111,7 +111,8 @@
 // caret variables
 static int CaretStatus;
 static BOOL CaretEnabled = TRUE;
-BOOL IMEstat;		/* IME Status  TRUE=IME ON */
+BOOL IMEstat;				/* IME Status  TRUE=IME ON */
+BOOL IMEShowingCandidate;	/* \x8C\xF3\x95\xE2\x83E\x83B\x83\x93\x83h\x83E\x95\\x8E\xA6\x8F\xF3\x8B\xB5 TRUE=\x95\\x8E\xA6\x92\x86 */
 
 // ---- device context and status flags
 static HDC VTDC = NULL; /* Device context for VT window */
@@ -2220,9 +2221,9 @@
 		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
+		if (IMEstat && IMEShowingCandidate) {
+			// IME ON && \x8C\xF3\x95\xE2\x83E\x83B\x83\x93\x83h\x83E\x95\\x8E\xA6\x92\x86\x82̏ꍇ\x82݂̂̏\x88\x97\x9D
+			// \x8C\xF3\x95\xE2\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);

Modified: trunk/teraterm/teraterm/vtdisp.h
===================================================================
--- trunk/teraterm/teraterm/vtdisp.h	2019-03-03 07:40:17 UTC (rev 7458)
+++ trunk/teraterm/teraterm/vtdisp.h	2019-03-03 16:03:33 UTC (rev 7459)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 1994-1998 T. Teranishi
- * (C) 2008-2017 TeraTerm Project
+ * (C) 2008-2019 TeraTerm Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -128,6 +128,7 @@
 extern TCharAttr DefCharAttr;
 
 extern BOOL IMEstat;
+extern BOOL IMEShowingCandidate;
 
 #define SCROLL_BOTTOM	1
 #define SCROLL_LINEDOWN	2

Modified: trunk/teraterm/teraterm/vtwin.cpp
===================================================================
--- trunk/teraterm/teraterm/vtwin.cpp	2019-03-03 07:40:17 UTC (rev 7458)
+++ trunk/teraterm/teraterm/vtwin.cpp	2019-03-03 16:03:33 UTC (rev 7459)
@@ -161,6 +161,7 @@
 	ON_WM_VSCROLL()
 	ON_WM_DEVICECHANGE()
 	ON_MESSAGE(WM_IME_STARTCOMPOSITION,OnIMEStartComposition)
+	ON_MESSAGE(WM_IME_ENDCOMPOSITION,OnIMEEndComposition)
 	ON_MESSAGE(WM_IME_COMPOSITION,OnIMEComposition)
 	ON_MESSAGE(WM_INPUTLANGCHANGE,OnIMEInputChange)
 	ON_MESSAGE(WM_IME_NOTIFY,OnIMENotify)
@@ -3199,6 +3200,8 @@
 
 LRESULT CVTWindow::OnIMEStartComposition(WPARAM wParam, LPARAM lParam)
 {
+	IMEShowingCandidate = TRUE;
+
 	// \x88ʒu\x82\xF0\x92ʒm\x82\xB7\x82\xE9
 	int CaretX = (CursorX-WinOrgX)*FontWidth;
 	int CaretY = (CursorY-WinOrgY)*FontHeight;
@@ -3207,6 +3210,12 @@
 	return CFrameWnd::DefWindowProc(WM_IME_STARTCOMPOSITION,wParam,lParam);
 }
 
+LRESULT CVTWindow::OnIMEEndComposition(WPARAM wParam, LPARAM lParam)
+{
+	IMEShowingCandidate = FALSE;
+	return CFrameWnd::DefWindowProc(WM_IME_ENDCOMPOSITION,wParam,lParam);
+}
+
 LRESULT CVTWindow::OnIMEComposition(WPARAM wParam, LPARAM lParam)
 {
 	HGLOBAL hstr;
@@ -3274,7 +3283,10 @@
 
 LONG CVTWindow::OnIMENotify(UINT wParam, LONG lParam)
 {
-	if (wParam == IMN_SETOPENSTATUS) {
+	switch (wParam) {
+	case IMN_SETOPENSTATUS: {
+		// \x93\xFC\x97̓R\x83\x93\x83e\x83L\x83X\x83g\x82̊J\x95\xF3\x91Ԃ\xAA\x8DX\x90V\x82\xB3\x82\xEA\x82\xE9(IME On/OFF)
+
 		// IME\x82\xCCOn/Off\x82\xF0\x8E擾\x82\xB7\x82\xE9
 		IMEstat = GetIMEOpenStatus();
 
@@ -3285,8 +3297,32 @@
 
 		// \x95`\x89\xE6
 		ChangeCaret();
+
+		break;
 	}
 
+	// \x8C\xF3\x95\xE2\x83E\x83B\x83\x93\x83h\x83E\x82̕\\x8E\xA6\x8F󋵒ʒm
+	// IME_OPENCANDIDATE / IMN_CLOSECANDIDATE \x83T\x83|\x81[\x83g\x8F\xF3\x8B\xB5
+	//
+	//  IME								status
+	//  --------------------------------+----------
+	//  MS IME \x93\xFA\x96{\x8C\xEA(Windows 10 1809)	suport
+	//  Google \x93\xFA\x96{\x8C\xEA\x93\xFC\x97\xCD(2.24.3250.0)	not support
+	//
+	// WM_IME_STARTCOMPOSITION, WM_IME_ENDCOMPOSITION\x82݂̂Ŕ\xBB\x92\xE8\x89”\\x82\xBE\x82\xAA
+	// \x94O\x82ׂ̈\xB1\x82̃\x81\x83b\x83Z\x81[\x83W\x82\xE0\x8F\x88\x97\x9D\x82\xB7\x82\xE9
+	case IMN_OPENCANDIDATE:
+		// \x8C\xF3\x95\xE2\x83E\x83B\x83\x93\x83h\x83E\x82\xF0\x8AJ\x82\xB1\x82\xA4\x82Ƃ\xB5\x82Ă\xA2\x82\xE9
+		IMEShowingCandidate = TRUE;
+		break;
+	case IMN_CLOSECANDIDATE:
+		// \x8C\xF3\x95\xE2\x83E\x83B\x83\x93\x83h\x83E\x82\xF0\x95‚\xB6\x82悤\x82Ƃ\xB5\x82Ă\xA2\x82\xE9
+		IMEShowingCandidate = FALSE;
+		break;
+	default:
+		break;
+	}
+
 	return CFrameWnd::DefWindowProc(WM_IME_NOTIFY,wParam,lParam);
 }
 

Modified: trunk/teraterm/teraterm/vtwin.h
===================================================================
--- trunk/teraterm/teraterm/vtwin.h	2019-03-03 07:40:17 UTC (rev 7458)
+++ trunk/teraterm/teraterm/vtwin.h	2019-03-03 16:03:33 UTC (rev 7459)
@@ -136,6 +136,7 @@
 	afx_msg LONG  OnExitSizeMove(UINT wParam, LONG lParam);
 //-->
 	afx_msg LRESULT OnIMEStartComposition(WPARAM wParam, LPARAM lParam);
+	afx_msg LRESULT OnIMEEndComposition(WPARAM wParam, LPARAM lParam);
 	afx_msg LONG OnIMEComposition(UINT wParam, LONG lParam);
 	afx_msg LONG OnIMEInputChange(UINT wParam, LONG lParam);
 	afx_msg LONG OnIMENotify(UINT wParam, LONG lParam);


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