You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@guacamole.apache.org by GitBox <gi...@apache.org> on 2022/07/07 17:00:25 UTC
[GitHub] [guacamole-server] jmuehlner commented on a diff in pull request #385: GUACAMOLE-1622: Restructured code to resolve scrollbar resizing bug.
jmuehlner commented on code in PR #385:
URL: https://github.com/apache/guacamole-server/pull/385#discussion_r916096556
##########
src/terminal/terminal.c:
##########
@@ -500,26 +453,42 @@ guac_terminal* guac_terminal_create(guac_client* client,
term->clipboard = guac_common_clipboard_alloc();
term->disable_copy = options->disable_copy;
- /* Calculate available text display area by character size */
- int rows, columns;
- calculate_rows_and_columns(term, height, width, &rows, &columns);
+ /* Set size of available screen area */
+ term->outer_width = width;
+ term->outer_height = height;
- /* Calculate available text display area in pixels */
+ /* Calculate available display area */
int available_height, available_width;
- calculate_height_and_width(term, rows, columns,
- &available_height, &available_width);
+ calculate_available_height_and_width(term,
+ height, width, &available_height, &available_width);
- /* Set size of available screen area */
- term->outer_height = height;
- term->outer_width = width;
+ /* Calculate dimensions */
+ int rows = available_height / term->display->char_height;
+ int columns = available_width / term->display->char_width;
- /* Set rows and columns size */
- term->term_height = rows;
- term->term_width = columns;
+ int margin = term->display->margin;
+
+ /* Keep height within predefined maximum */
+ if (rows > GUAC_TERMINAL_MAX_ROWS) {
+ rows = GUAC_TERMINAL_MAX_ROWS;
+ available_height = rows * term->display->char_height;
+ height = available_height + 2*margin;
Review Comment:
Style nitpick: Some spaces between the `*` and associated operands would be nice here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org