[Ttssh2-commit] [3688] PasteDelayPerLineが正しく働いていなかったのを修正。

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 11月 19日 (木) 21:39:50 JST


Revision: 3688
          http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=3688
Author:   doda
Date:     2009-11-19 21:39:49 +0900 (Thu, 19 Nov 2009)

Log Message:
-----------
PasteDelayPerLineが正しく働いていなかったのを修正。

Modified Paths:
--------------
    trunk/teraterm/common/tttypes.h
    trunk/teraterm/teraterm/clipboar.c


-------------- next part --------------
Modified: trunk/teraterm/common/tttypes.h
===================================================================
--- trunk/teraterm/common/tttypes.h	2009-11-17 16:15:05 UTC (rev 3687)
+++ trunk/teraterm/common/tttypes.h	2009-11-19 12:39:49 UTC (rev 3688)
@@ -14,6 +14,7 @@
 #define IdPrnStartTimer      8
 #define IdPrnProcTimer       9
 #define IdCancelConnectTimer 10  // add (2007.1.10 yutaka)
+#define IdPasteDelayTimer    11
 
   /* Window Id */
 #define IdVT  1

Modified: trunk/teraterm/teraterm/clipboar.c
===================================================================
--- trunk/teraterm/teraterm/clipboar.c	2009-11-17 16:15:05 UTC (rev 3687)
+++ trunk/teraterm/teraterm/clipboar.c	2009-11-19 12:39:49 UTC (rev 3688)
@@ -157,11 +157,19 @@
 {
 	int c;
 	BOOL EndFlag;
+	static DWORD lastcr;
+	DWORD now;
 
 	if (CBMemHandle==NULL) {
 		return;
 	}
 
+	now = GetTickCount();
+	if (now < lastcr + ts.PasteDelayPerLine ||
+	   (now > lastcr && lastcr + ts.PasteDelayPerLine < lastcr)) {
+		return;
+	}
+
 	if (CBRetrySend) {
 		CBRetryEcho = (ts.LocalEcho>0);
 		c = CommTextOut(&cv,(PCHAR)&CBByte,1);
@@ -188,8 +196,9 @@
 		if (CBSendCR && (CBMemPtr[CBMemPtr2]==0x0a)) {
 			CBMemPtr2++;
 			// added PasteDelayPerLine (2009.4.12 maya)
-			Sleep(ts.PasteDelayPerLine);
+			lastcr = now;
 			CBSendCR = FALSE;
+			SetTimer(HVTWin, IdPasteDelayTimer, ts.PasteDelayPerLine, NULL);
 			break;
 		}
 



Ttssh2-commit メーリングリストの案内
Back to archive index