[Ttssh2-commit] [5341] SelectOnActivate= off の時は、Focus In後の最初のボタンリリースイベントを送らないようにした。

svnno****@sourc***** svnno****@sourc*****
2013年 7月 8日 (月) 17:35:29 JST


Revision: 5341
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/5341
Author:   doda
Date:     2013-07-08 17:35:29 +0900 (Mon, 08 Jul 2013)
Log Message:
-----------
SelectOnActivate=off の時は、Focus In後の最初のボタンリリースイベントを送らないようにした。

Modified Paths:
--------------
    trunk/teraterm/teraterm/vtwin.cpp

-------------- next part --------------
Modified: trunk/teraterm/teraterm/vtwin.cpp
===================================================================
--- trunk/teraterm/teraterm/vtwin.cpp	2013-07-04 08:46:00 UTC (rev 5340)
+++ trunk/teraterm/teraterm/vtwin.cpp	2013-07-08 08:35:29 UTC (rev 5341)
@@ -78,6 +78,8 @@
 static BOOL TCPLocalEchoUsed = FALSE;
 static BOOL TCPCRSendUsed = FALSE;
 
+static BOOL IgnoreRelease = FALSE;
+
 // \x96{\x91̂\xCD addsetting.cpp
 extern mouse_cursor_t MouseCursor[];
 
@@ -2163,7 +2165,10 @@
 
 void CVTWindow::OnLButtonUp(UINT nFlags, CPoint point)
 {
-	MouseReport(IdMouseEventBtnUp, IdLeftButton, point.x, point.y);
+	if (IgnoreRelease)
+		IgnoreRelease = FALSE;
+	else
+		MouseReport(IdMouseEventBtnUp, IdLeftButton, point.x, point.y);
 
 	if (! LButton) {
 		return;
@@ -2185,7 +2190,10 @@
 {
 	BOOL mousereport;
 
-	mousereport = MouseReport(IdMouseEventBtnUp, IdMiddleButton, point.x, point.y);
+	if (IgnoreRelease)
+		IgnoreRelease = FALSE;
+	else
+		mousereport = MouseReport(IdMouseEventBtnUp, IdMiddleButton, point.x, point.y);
 
 	if (! MButton) {
 		return;
@@ -2202,11 +2210,13 @@
 
 int CVTWindow::OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message)
 {
-	if ((ts.SelOnActive==0) &&
-	    (nHitTest==HTCLIENT))   //disable mouse event for text selection
+	if ((ts.SelOnActive==0) && (nHitTest==HTCLIENT)) { //disable mouse event for text selection
+		IgnoreRelease = TRUE;
 		return MA_ACTIVATEANDEAT; //     when window is activated
-	else
+	}
+	else {
 		return MA_ACTIVATE;
+	}
 }
 
 void CVTWindow::OnMouseMove(UINT nFlags, CPoint point)
@@ -2214,7 +2224,8 @@
 	int i;
 	BOOL mousereport;
 
-	mousereport = MouseReport(IdMouseEventMove, 0, point.x, point.y);
+	if (!IgnoreRelease)
+		mousereport = MouseReport(IdMouseEventMove, 0, point.x, point.y);
 
 	if (! (LButton || MButton || RButton)) {
 		if (BuffCheckMouseOnURL(point.x, point.y))
@@ -2359,7 +2370,10 @@
 {
 	BOOL mousereport;
 
-	mousereport = MouseReport(IdMouseEventBtnUp, IdRightButton, point.x, point.y);
+	if (IgnoreRelease)
+		IgnoreRelease = FALSE;
+	else
+		mousereport = MouseReport(IdMouseEventBtnUp, IdRightButton, point.x, point.y);
 
 	if (! RButton) {
 		return;



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