[Ttssh2-commit] [7272] dttermのウィンドウ操作シーケンス(15:ルートウィンドウサイズ報告(pixel))に対応

scmno****@osdn***** scmno****@osdn*****
2018年 11月 21日 (水) 17:45:29 JST


Revision: 7272
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/7272
Author:   doda
Date:     2018-11-21 17:45:29 +0900 (Wed, 21 Nov 2018)
Log Message:
-----------
dttermのウィンドウ操作シーケンス(15:ルートウィンドウサイズ報告(pixel))に対応

19:ルートウィンドウサイズ報告(char)ではウィンドウの枠/メニュー部分の
サイズを引いた値で計算しているけれど、これってなんでだっけ?
必要ないような気がする。

今回の実装(15)では引いていない。

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:25 UTC (rev 7271)
+++ trunk/teraterm/teraterm/vtdisp.c	2018-11-21 08:45:29 UTC (rev 7272)
@@ -3824,7 +3824,7 @@
 	return;
 }
 
-void DispGetRootWinSize(int *x, int *y)
+void DispGetRootWinSize(int *x, int *y, BOOL inPixels)
 {
 	HMODULE mod;
 	HMONITOR monitor;
@@ -3847,8 +3847,14 @@
 		SystemParametersInfo(SPI_GETWORKAREA, 0, &desktop, 0);
 	}
 
-	*x = (desktop.right - desktop.left - (win.right - win.left - client.right)) / FontWidth;
-	*y = (desktop.bottom - desktop.top - (win.bottom - win.top - client.bottom)) / FontHeight;
+	if (inPixels) {
+		*x = desktop.right - desktop.left;
+		*y = desktop.bottom - desktop.top;
+	}
+	else {
+		*x = (desktop.right - desktop.left - (win.right - win.left - client.right)) / FontWidth;
+		*y = (desktop.bottom - desktop.top - (win.bottom - win.top - client.bottom)) / FontHeight;
+	}
 
 	return;
 }

Modified: trunk/teraterm/teraterm/vtdisp.h
===================================================================
--- trunk/teraterm/teraterm/vtdisp.h	2018-11-21 08:45:25 UTC (rev 7271)
+++ trunk/teraterm/teraterm/vtdisp.h	2018-11-21 08:45:29 UTC (rev 7272)
@@ -113,7 +113,7 @@
 BOOL DispWindowIconified();
 void DispGetWindowPos(int *x, int *y, BOOL client);
 void DispGetWindowSize(int *width, int *height, BOOL client);
-void DispGetRootWinSize(int *x, int *y);
+void DispGetRootWinSize(int *x, int *y, BOOL inPixels);
 int DispFindClosestColor(int red, int green, int blue);
 void UpdateBGBrush(void);
 

Modified: trunk/teraterm/teraterm/vtterm.c
===================================================================
--- trunk/teraterm/teraterm/vtterm.c	2018-11-21 08:45:25 UTC (rev 7271)
+++ trunk/teraterm/teraterm/vtterm.c	2018-11-21 08:45:29 UTC (rev 7272)
@@ -2455,6 +2455,14 @@
 		}
 		break;
 
+	  case 15: // Report display size (pixel)
+		if (ts.WindowFlag & WF_WINDOWREPORT) {
+			DispGetRootWinSize(&x, &y, TRUE);
+			len = _snprintf_s_l(Report, sizeof(Report), _TRUNCATE, "5;%d;%dt", CLocale, y, x);
+			SendCSIstr(Report, len);
+		}
+		break;
+
 	  case 18: /* get terminal size */
 		if (ts.WindowFlag & WF_WINDOWREPORT) {
 			len = _snprintf_s_l(Report, sizeof(Report), _TRUNCATE, "8;%u;%ut", CLocale,
@@ -2465,7 +2473,7 @@
 
 	  case 19: // Report display size (character)
 		if (ts.WindowFlag & WF_WINDOWREPORT) {
-			DispGetRootWinSize(&x, &y);
+			DispGetRootWinSize(&x, &y, FALSE);
 			len = _snprintf_s_l(Report, sizeof(Report), _TRUNCATE, "9;%d;%dt", CLocale, y, x);
 			SendCSIstr(Report, len);
 		}


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