From 19564cd133112242d6d2ace2f54584a3313f1e30 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 20 Feb 2012 11:04:08 -0800 Subject: [PATCH] Move cursor layer rather than redraw. --- protocols/ssh/src/ssh_client.c | 10 ++++++++++ protocols/ssh/src/ssh_terminal.c | 19 ++++--------------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/protocols/ssh/src/ssh_client.c b/protocols/ssh/src/ssh_client.c index 462950dc..185b175f 100644 --- a/protocols/ssh/src/ssh_client.c +++ b/protocols/ssh/src/ssh_client.c @@ -124,6 +124,16 @@ int guac_client_init(guac_client* client, int argc, char** argv) { term->char_width * term->term_width, term->char_height * term->term_height); + /* Cursor layer need only be one char */ + guac_protocol_send_size(socket, term->cursor_layer, term->char_width, term->char_height); + + /* Draw cursor */ + guac_protocol_send_rect(socket, + GUAC_COMP_OVER, term->cursor_layer, + 0, 0, term->char_width, term->char_height, + 0x40, 0xFF, 0x80, + 0x80); + guac_socket_flush(socket); /* Open SSH session */ diff --git a/protocols/ssh/src/ssh_terminal.c b/protocols/ssh/src/ssh_terminal.c index c73441a9..34d1b87f 100644 --- a/protocols/ssh/src/ssh_terminal.c +++ b/protocols/ssh/src/ssh_terminal.c @@ -253,24 +253,13 @@ int ssh_guac_terminal_redraw_cursor(ssh_guac_terminal* term) { /* Erase old cursor */ return - guac_protocol_send_rect(socket, - GUAC_COMP_ROUT, term->cursor_layer, - - 0, 0, - term->char_width * term->term_width, - term->char_height * term->term_height, - - 0, 0, 0, 0xFF) - - || guac_protocol_send_rect(socket, - GUAC_COMP_OVER, term->cursor_layer, + guac_protocol_send_move(socket, + term->cursor_layer, + GUAC_DEFAULT_LAYER, term->char_width * term->cursor_col, term->char_height * term->cursor_row, - term->char_width, term->char_height, - - 0x40, 0xFF, 0x80, - 0x80); + 1); }