From: simon Date: Tue, 15 Oct 2002 15:16:21 +0000 (+0000) Subject: Don't forget to initialise the pixel size parameters of the window X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/commitdiff_plain/e9aef757874467ea2dbc10b8471ca992d1fa6c6a Don't forget to initialise the pixel size parameters of the window as passed to the pty... git-svn-id: svn://svn.tartarus.org/sgt/putty@2064 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/unix/pterm.c b/unix/pterm.c index d4b8f4d3..b5625ea5 100644 --- a/unix/pterm.c +++ b/unix/pterm.c @@ -79,6 +79,14 @@ void logevent(char *string) */ } +int font_dimension(int which) /* 0 for width, 1 for height */ +{ + if (which) + return inst->font_height; + else + return inst->font_width; +} + /* * Translate a raw mouse button designation (LEFT, MIDDLE, RIGHT) * into a cooked one (SELECT, EXTEND, PASTE). diff --git a/unix/pty.c b/unix/pty.c index a3d2fc73..0d7b7fe3 100644 --- a/unix/pty.c +++ b/unix/pty.c @@ -402,6 +402,8 @@ static void pty_size(void) size.ws_row = (unsigned short)rows; size.ws_col = (unsigned short)cols; + size.ws_xpixel = (unsigned short) cols * font_dimension(0); + size.ws_ypixel = (unsigned short) rows * font_dimension(1); ioctl(pty_master_fd, TIOCSWINSZ, (void *)&size); return; } diff --git a/unix/unix.h b/unix/unix.h index 8e645a2d..2365f07f 100644 --- a/unix/unix.h +++ b/unix/unix.h @@ -37,7 +37,9 @@ int wc_to_mb(int codepage, int flags, wchar_t *wcstr, int wclen, char *mbstr, int mblen, char *defchr, int *defused); void init_ucs(void); +/* Things pty.c needs from pterm.c */ char *get_x_display(void); +int font_dimension(int which); /* 0 for width, 1 for height */ #define DEFAULT_CODEPAGE 0 /* FIXME: no idea how to do this */