Skip to content

Commit

Permalink
GUACAMOLE-377: Merge correction to handling of display redraw followi…
Browse files Browse the repository at this point in the history
…ng terminal buffer switch.
  • Loading branch information
mike-jumper authored Oct 1, 2024
2 parents c056b74 + ab3cda9 commit be51ad1
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 9 deletions.
7 changes: 7 additions & 0 deletions src/terminal/terminal-handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,13 @@ int guac_terminal_csi(guac_terminal* term, unsigned char c) {
guac_terminal_scrollbar_set_bounds(term->scrollbar,
-guac_terminal_get_available_scroll(term), 0);

/* Redraw normal buffer content */
guac_terminal_redraw_default_layer(term);

/* Clear selection */
term->text_selected = false;
term->selection_committed = false;

}

/* Clear normal buffer only if we were previously using
Expand Down
20 changes: 11 additions & 9 deletions src/terminal/terminal.c
Original file line number Diff line number Diff line change
Expand Up @@ -2121,10 +2121,7 @@ void guac_terminal_apply_color_scheme(guac_terminal* terminal,
display->default_background = default_char->attributes.background;

/* 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);
guac_terminal_redraw_default_layer(terminal);

/* Acquire exclusive access to terminal */
guac_terminal_lock(terminal);
Expand All @@ -2147,7 +2144,6 @@ const char* guac_terminal_get_color_scheme(guac_terminal* terminal) {
void guac_terminal_apply_font(guac_terminal* terminal, const char* font_name,
int font_size, int dpi) {

guac_client* client = terminal->client;
guac_terminal_display* display = terminal->display;

if (guac_terminal_display_set_font(display, font_name, font_size, dpi))
Expand All @@ -2159,10 +2155,7 @@ void guac_terminal_apply_font(guac_terminal* terminal, const char* font_name,
terminal->outer_height);

/* 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);
guac_terminal_redraw_default_layer(terminal);

/* Acquire exclusive access to terminal */
guac_terminal_lock(terminal);
Expand Down Expand Up @@ -2228,3 +2221,12 @@ void guac_terminal_remove_user(guac_terminal* terminal, guac_user* user) {
/* Remove the user from the terminal cursor */
guac_common_cursor_remove_user(terminal->cursor, user);
}

void guac_terminal_redraw_default_layer(guac_terminal* terminal) {

/* Redraw terminal text and background */
guac_terminal_repaint_default_layer(terminal, terminal->client->socket);
__guac_terminal_redraw_rect(terminal, 0, 0,
terminal->term_height - 1,
terminal->term_width - 1);
}
8 changes: 8 additions & 0 deletions src/terminal/terminal/terminal-priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -682,4 +682,12 @@ void guac_terminal_copy_rows(guac_terminal* terminal,
*/
void guac_terminal_flush(guac_terminal* terminal);

/**
* Redraw default layer text and background.
*
* @param terminal
* The terminal to redraw.
*/
void guac_terminal_redraw_default_layer(guac_terminal* terminal);

#endif

0 comments on commit be51ad1

Please sign in to comment.