mike-jumper commented on code in PR #385:
URL: https://github.com/apache/guacamole-server/pull/385#discussion_r920512889


##########
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:
   Welp, these changes as they stand now are definitely nice, readable, and 
minimal. If you can squash that "Propose a fix ..." commit up into the main 
commit (or rephrase to capture the nature of the change rather than the nature 
of the PR workflow), I'm happy to merge.



-- 
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]

Reply via email to