From f293c5e9c076d583f2f513a7673928da4395814c Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 24 Sep 2018 01:28:30 -0700 Subject: [PATCH] GUACAMOLE-630: Do not entirely reset terminal state when color scheme is changed. --- src/terminal/terminal.c | 9 +++++---- src/terminal/terminal/terminal.h | 5 ++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/terminal/terminal.c b/src/terminal/terminal.c index c12df4b9..1984185d 100644 --- a/src/terminal/terminal.c +++ b/src/terminal/terminal.c @@ -1954,15 +1954,16 @@ void guac_terminal_apply_color_scheme(guac_terminal* terminal, display->default_palette); /* Reinitialize default attributes of buffer and display */ - terminal->buffer->default_character = *default_char; + guac_terminal_display_reset_palette(display); display->default_foreground = default_char->attributes.foreground; display->default_background = default_char->attributes.background; - /* Redraw background with new color */ + /* Redraw terminal text and background */ guac_terminal_repaint_default_layer(terminal, client->socket); + __guac_terminal_redraw_rect(terminal, 0, 0, + terminal->term_height - 1, + terminal->term_width - 1); - /* Force reset of terminal state */ - guac_terminal_reset(terminal); guac_terminal_notify(terminal); } diff --git a/src/terminal/terminal/terminal.h b/src/terminal/terminal/terminal.h index 6de984bf..28085f67 100644 --- a/src/terminal/terminal/terminal.h +++ b/src/terminal/terminal/terminal.h @@ -1074,9 +1074,8 @@ int guac_terminal_available_scroll(guac_terminal* term); /** * Immediately applies the given color scheme to the given terminal, overriding - * the color scheme provided when the terminal was created. Applying the color - * scheme implicitly clears the display and resets the terminal state. Valid - * color schemes are those accepted by guac_terminal_parse_color_scheme(). + * the color scheme provided when the terminal was created. Valid color schemes + * are those accepted by guac_terminal_parse_color_scheme(). * * @param terminal * The terminal to apply the color scheme to.