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 9229457dd4
commit 4766970015
2 changed files with 9 additions and 0 deletions

View File

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

View File

@ -753,6 +753,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 */ /* Commit new dimensions */
term->term_width = width; term->term_width = width;
term->term_height = height; term->term_height = height;