1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-04-09 23:28:06 -05:00

Don't forget to initialise the pixel size parameters of the window

as passed to the pty...

[originally from svn r2064]
This commit is contained in:
Simon Tatham 2002-10-15 15:16:21 +00:00
parent 60935859d5
commit e18cf6b714
3 changed files with 12 additions and 0 deletions

View File

@ -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).

View File

@ -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;
}

View File

@ -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 */