[Ttssh2-commit] [7271] dttermのウィンドウ操作シーケンス(13:ウィンドウ位置報告)の動作を更新

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2018年 11月 21日 (水) 17:45:25 JST


Revision: 7271
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/7271
Author:   doda
Date:     2018-11-21 17:45:25 +0900 (Wed, 21 Nov 2018)
Log Message:
-----------
dttermのウィンドウ操作シーケンス(13:ウィンドウ位置報告)の動作を更新

- 二番目のパラメータ(Ps2)の値を見るように変更
  - Ps2 が 0 または 1 の時は Ps2 が無い時の動作に合わせた
  - Ps2 が 2 の時はクライアント領域の位置を送るようにした
  - Ps2 がそれ以外の値の時は応答しないようにした

最後の以外は xterm の動作への追従。
xterm では Ps2 が 0 - 2 以外の時は 0 と同じ動作をしているが、
Tera Term ではあえて無視する。

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

-------------- next part --------------
Modified: trunk/teraterm/teraterm/vtdisp.c
===================================================================
--- trunk/teraterm/teraterm/vtdisp.c	2018-11-21 08:45:21 UTC (rev 7270)
+++ trunk/teraterm/teraterm/vtdisp.c	2018-11-21 08:45:25 UTC (rev 7271)
@@ -3781,20 +3781,29 @@
 	return IsIconic(HVTWin);
 }
 
-void DispGetWindowPos(int *x, int *y) {
+void DispGetWindowPos(int *x, int *y, BOOL client) {
 	WINDOWPLACEMENT wndpl;
+	POINT point;
 
-	wndpl.length = sizeof(WINDOWPLACEMENT);
-	GetWindowPlacement(HVTWin, &wndpl);
+	if (client) {
+		point.x = point.y = 0;
+		ClientToScreen(HVTWin, &point);
+		*x = point.x;
+		*y = point.y;
+	}
+	else {
+		wndpl.length = sizeof(WINDOWPLACEMENT);
+		GetWindowPlacement(HVTWin, &wndpl);
 
-	switch (wndpl.showCmd) {
-	  case SW_SHOWMAXIMIZED:
-		*x = wndpl.ptMaxPosition.x;
-		*y = wndpl.ptMaxPosition.y;
-		break;
-	  default:
-		*x = wndpl.rcNormalPosition.left;
-		*y = wndpl.rcNormalPosition.top;
+		switch (wndpl.showCmd) {
+		  case SW_SHOWMAXIMIZED:
+			*x = wndpl.ptMaxPosition.x;
+			*y = wndpl.ptMaxPosition.y;
+			break;
+		  default:
+			*x = wndpl.rcNormalPosition.left;
+			*y = wndpl.rcNormalPosition.top;
+		}
 	}
 
 	return;

Modified: trunk/teraterm/teraterm/vtdisp.h
===================================================================
--- trunk/teraterm/teraterm/vtdisp.h	2018-11-21 08:45:21 UTC (rev 7270)
+++ trunk/teraterm/teraterm/vtdisp.h	2018-11-21 08:45:25 UTC (rev 7271)
@@ -111,7 +111,7 @@
 void DispShowWindow(int mode);
 void DispResizeWin(int w, int h);
 BOOL DispWindowIconified();
-void DispGetWindowPos(int *x, int *y);
+void DispGetWindowPos(int *x, int *y, BOOL client);
 void DispGetWindowSize(int *width, int *height, BOOL client);
 void DispGetRootWinSize(int *x, int *y);
 int DispFindClosestColor(int red, int green, int blue);

Modified: trunk/teraterm/teraterm/vtterm.c
===================================================================
--- trunk/teraterm/teraterm/vtterm.c	2018-11-21 08:45:21 UTC (rev 7270)
+++ trunk/teraterm/teraterm/vtterm.c	2018-11-21 08:45:25 UTC (rev 7271)
@@ -2418,7 +2418,18 @@
 
 	  case 13: // Report window position
 		if (ts.WindowFlag & WF_WINDOWREPORT) {
-			DispGetWindowPos(&x, &y);
+			RequiredParams(2);
+			switch (Param[2]) {
+			  case 0:
+			  case 1:
+				DispGetWindowPos(&x, &y, FALSE);
+				break;
+			  case 2:
+				DispGetWindowPos(&x, &y, TRUE);
+				break;
+			  default:
+				return;
+			}
 			len = _snprintf_s_l(Report, sizeof(Report), _TRUNCATE, "3;%u;%ut", CLocale, (unsigned int)x, (unsigned int)y);
 			SendCSIstr(Report, len);
 		}


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