aleitner commented on code in PR #385:
URL: https://github.com/apache/guacamole-server/pull/385#discussion_r920344750


##########
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:
   This would work for `guac_terminal_create()` but `guac_terminal_resize()` 
needs the rows and columns to be returned and used later rather than be set on 
the terminal struct



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