svnno****@sourc*****
svnno****@sourc*****
2011年 7月 26日 (火) 17:18:19 JST
Revision: 4530 http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=4530 Author: doda Date: 2011-07-26 17:18:19 +0900 (Tue, 26 Jul 2011) Log Message: ----------- æ£ããã¦ã£ã³ãã¦ãµã¤ãº(ãã¯ã»ã«æ°)ãéç¥ããããã«ããã GetWindowRect() ã§ã¯ãªã GetClientRect() ã使ã£ãæ¹ããããããªæ°ãããããåãããã <CSI>14t ã®åä½ã«åãããã Modified Paths: -------------- trunk/ttssh2/ttxssh/ssh.c -------------- next part -------------- Modified: trunk/ttssh2/ttxssh/ssh.c =================================================================== --- trunk/ttssh2/ttxssh/ssh.c 2011-07-25 15:30:43 UTC (rev 4529) +++ trunk/ttssh2/ttxssh/ssh.c 2011-07-26 08:18:19 UTC (rev 4530) @@ -2772,8 +2772,26 @@ } } +void get_window_pixel_size(PTInstVar pvar, int *x, int *y) +{ + RECT r; + + if (pvar->cv->HWin && GetWindowRect(pvar->cv->HWin, &r)) { + *x = r.right - r.left; + *y = r.bottom - r.top; + } + else { + *x = 0; + *y = 0; + } + + return; +} + void SSH_notify_win_size(PTInstVar pvar, int cols, int rows) { + int x, y; + pvar->ssh_state.win_cols = cols; pvar->ssh_state.win_rows = rows; @@ -2812,8 +2830,9 @@ buffer_put_char(msg, 0); // wantconfirm buffer_put_int(msg, pvar->ssh_state.win_cols); // columns buffer_put_int(msg, pvar->ssh_state.win_rows); // lines - buffer_put_int(msg, 480); // XXX: - buffer_put_int(msg, 640); // XXX: + get_window_pixel_size(pvar, &x, &y); + buffer_put_int(msg, x); // window width (pixel): + buffer_put_int(msg, y); // window height (pixel): len = buffer_len(msg); outmsg = begin_send_packet(pvar, SSH2_MSG_CHANNEL_REQUEST, len); memcpy(outmsg, buffer_ptr(msg), len); @@ -6948,7 +6967,7 @@ buffer_t *msg, *ttymsg; char *s = "pty-req"; // pseudo terminalÌNGXg unsigned char *outmsg; - int len; + int len, x, y; #ifdef DONT_WANTCONFIRM int wantconfirm = 0; // false #else @@ -6976,8 +6995,9 @@ buffer_put_string(msg, s, strlen(s)); buffer_put_int(msg, pvar->ssh_state.win_cols); // columns buffer_put_int(msg, pvar->ssh_state.win_rows); // lines - buffer_put_int(msg, 480); // XXX: - buffer_put_int(msg, 640); // XXX: + get_window_pixel_size(pvar, &x, &y); + buffer_put_int(msg, x); // window width (pixel): + buffer_put_int(msg, y); // window height (pixel): // TTY modeͱ±Ån· (2005.7.17 yutaka) #if 0