[Ttssh2-commit] [3302] ウィンドウ最小化 / 最大化制御シーケンス ( dtterm由来 ?) に対応。

svnno****@sourc***** svnno****@sourc*****
2009年 4月 10日 (金) 21:44:00 JST


Revision: 3302
          http://svn.sourceforge.jp/view?root=ttssh2&view=rev&rev=3302
Author:   doda
Date:     2009-04-10 21:44:00 +0900 (Fri, 10 Apr 2009)

Log Message:
-----------
ウィンドウ最小化/最大化制御シーケンス(dtterm由来?)に対応。
  <CSI> Ps t
    Ps=1	最小化解除
       2	最小化
       9;0	最大化解除
       9;1	最大化

ウィンドウ位置変更もだけど、セキュリティ的には受け入れるか設定できた方がいいと思われる。

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	2009-04-10 11:55:03 UTC (rev 3301)
+++ trunk/teraterm/teraterm/vtdisp.c	2009-04-10 12:44:00 UTC (rev 3302)
@@ -3355,3 +3355,7 @@
 #endif  // ALPHABLEND_TYPE2
   }
 }
+
+void DispShowWindow(int mode) {
+	ShowWindow(HVTWin, mode);
+}

Modified: trunk/teraterm/teraterm/vtdisp.h
===================================================================
--- trunk/teraterm/teraterm/vtdisp.h	2009-04-10 11:55:03 UTC (rev 3301)
+++ trunk/teraterm/teraterm/vtdisp.h	2009-04-10 12:44:00 UTC (rev 3302)
@@ -80,6 +80,7 @@
 COLORREF DispGetANSIColor(int num);
 void DispSetCurCharAttr(TCharAttr Attr);
 void DispMoveWindow(int x, int y);
+void DispShowWindow(int mode);
 
 extern int WinWidth, WinHeight;
 extern HFONT VTFont[AttrFontMask+1];

Modified: trunk/teraterm/teraterm/vtterm.c
===================================================================
--- trunk/teraterm/teraterm/vtterm.c	2009-04-10 11:55:03 UTC (rev 3301)
+++ trunk/teraterm/teraterm/vtterm.c	2009-04-10 12:44:00 UTC (rev 3302)
@@ -1750,7 +1750,13 @@
     char Report[16];
 
     switch (Param[1]) {
-      case 3:
+      case 1: // De-iconify window
+	DispShowWindow(SW_RESTORE);
+	break;
+      case 2: // Iconify window
+	DispShowWindow(SW_MINIMIZE);
+	break;
+      case 3: // set window position
 	if (NParam < 2) Param[2] = 0;
 	if (NParam < 3) Param[3] = 0;
 	DispMoveWindow(Param[2], Param[3]);
@@ -1760,6 +1766,14 @@
 	if ((Param[3]<=1) || (NParam<3)) Param[3] = 80;
 	ChangeTerminalSize(Param[3],Param[2]);
 	break;
+      case 9: // Maximize/Restore window
+	if (NParam < 2 || Param[2] == 0) {
+	  DispShowWindow(SW_RESTORE);
+	}
+	else {
+	  DispShowWindow(SW_MAXIMIZE);
+	}
+	break;
       case 14: /* get window size??? */
 	/* this is not actual window size */
 	if (Send8BitMode)



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