aleitner commented on code in PR #385:
URL: https://github.com/apache/guacamole-server/pull/385#discussion_r919565802
##########
src/terminal/terminal.c:
##########
@@ -500,26 +528,33 @@ 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 of text in pixels */
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 available display area of text by character size */
+ int rows, columns;
+ calculate_rows_and_columns(term, available_height, available_width,
+ &rows, &columns);
- /* Set rows and columns size */
- term->term_height = rows;
- term->term_width = columns;
+ /* Calculate height & width within predefined maximum of rows and columns
*/
+ int adjusted_height = height;
+ int adjusted_width = width;
+ calculate_adjusted_height_and_width(term, rows, columns,
+ &adjusted_height, &adjusted_width);
/* Set pixel size */
- term->height = available_height;
- term->width = available_width;
+ term->width = adjusted_width;
+ term->height = adjusted_height;
Review Comment:
I have pushed a commit that shows a solution that tries to make as few
changes as possible to resolve the issue, but I feel that previous commit
`f6fcd357616b517eaf19f41c77538704f5a44e24` is a more solid design
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]