GUAC-621: During resize, keep cursor on screen and redraw cursor if necessary.

This commit is contained in:
Michael Jumper 2014-04-16 14:46:00 -07:00
parent 41edeb93f2
commit d0599748bc
2 changed files with 9 additions and 0 deletions

View File

@ -393,6 +393,9 @@ int ssh_guac_client_size_handler(guac_client* client, int width, int height) {
/* Resize terminal */
guac_terminal_resize(terminal, columns, rows);
/* Update cursor */
guac_terminal_commit_cursor(terminal);
/* Update SSH pty size if connected */
if (guac_client_data->term_channel != NULL)
channel_change_pty_size(guac_client_data->term_channel,

View File

@ -769,6 +769,12 @@ void guac_terminal_resize(guac_terminal* term, int width, int height) {
}
/* Keep cursor on screen */
if (term->cursor_row < 0) term->cursor_row = 0;
if (term->cursor_row >= height) term->cursor_row = height-1;
if (term->cursor_col < 0) term->cursor_col = 0;
if (term->cursor_col >= width) term->cursor_col = width-1;
/* Commit new dimensions */
term->term_width = width;
term->term_height = height;