mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-06-30 19:12:48 -05:00
Change Seat's get_char_cell_size to get_window_pixel_size.
That's more directly useful in uxpty.c (which is currently the only actual client of the function), and also matches the data that SSH clients send in "pty-req". Also, it makes that method behave more like the GUI query function get_window_pixels used by terminal.c (with the sole exception that unlike g_w_p it's allowed to return failure), so it becomes even more trivial to implement in the GUI front ends.
This commit is contained in:
@ -340,11 +340,10 @@ static int gtk_seat_is_utf8(Seat *seat)
|
||||
return frontend_is_utf8(inst);
|
||||
}
|
||||
|
||||
static int gtk_seat_get_char_cell_size(Seat *seat, int *w, int *h)
|
||||
static int gtk_seat_get_window_pixel_size(Seat *seat, int *w, int *h)
|
||||
{
|
||||
Frontend *inst = container_of(seat, Frontend, seat);
|
||||
*w = inst->font_width;
|
||||
*h = inst->font_height;
|
||||
get_window_pixels(inst, w, h);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -376,7 +375,7 @@ static const SeatVtable gtk_seat_vt = {
|
||||
#else
|
||||
gtk_seat_get_windowid,
|
||||
#endif
|
||||
gtk_seat_get_char_cell_size,
|
||||
gtk_seat_get_window_pixel_size,
|
||||
};
|
||||
|
||||
static void gtk_eventlog(LogPolicy *lp, const char *string)
|
||||
|
@ -394,7 +394,7 @@ static const SeatVtable plink_seat_vt = {
|
||||
plink_echoedit_update,
|
||||
nullseat_get_x_display,
|
||||
nullseat_get_windowid,
|
||||
nullseat_get_char_cell_size,
|
||||
nullseat_get_window_pixel_size,
|
||||
};
|
||||
static Seat plink_seat[1] = {{ &plink_seat_vt }};
|
||||
|
||||
|
@ -1155,12 +1155,12 @@ static void pty_size(Backend *be, int width, int height)
|
||||
pty->term_width = width;
|
||||
pty->term_height = height;
|
||||
|
||||
seat_get_char_cell_size(pty->seat, &xpixel, &ypixel);
|
||||
seat_get_window_pixel_size(pty->seat, &xpixel, &ypixel);
|
||||
|
||||
size.ws_row = (unsigned short)pty->term_height;
|
||||
size.ws_col = (unsigned short)pty->term_width;
|
||||
size.ws_xpixel = (unsigned short)pty->term_width * xpixel;
|
||||
size.ws_ypixel = (unsigned short)pty->term_height * ypixel;
|
||||
size.ws_xpixel = (unsigned short)xpixel;
|
||||
size.ws_ypixel = (unsigned short)ypixel;
|
||||
ioctl(pty->master_fd, TIOCSWINSZ, (void *)&size);
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user