aleitner commented on code in PR #383:
URL: https://github.com/apache/guacamole-server/pull/383#discussion_r894849128
##########
src/terminal/terminal.c:
##########
@@ -335,6 +335,67 @@ guac_terminal_options* guac_terminal_options_create(
return options;
}
+/**
+ * Calculate the available space within the terminal
+ * and store the results in the pointer arguments.
+ *
+ * @param terminal
+ * The terminal provides character width and height for calculations.
+ *
+ * @param width
+ * The width of the terminal, in pixels.
+ *
+ * @param height
+ * The height of the terminal, in pixels.
+ *
+ * @param aw
+ * Set with the available width for text of the terminal, in pixels.
+ *
+ * @param ah
+ * Set with the available height for text of the terminal, in pixels.
+ *
+ * @param columns
+ * Set with the available width for text of the terminal, by column count.
+ *
+ * @param rows
+ * Set with the available height for text of the terminal, by row count.
+ */
+static void get_available_dimensions(guac_terminal* term, int width, int
height,
+ int* aw, int* ah, int* columns, int* rows) {
Review Comment:
1) It looks like both locations where `get_available_dimensions` is called
we end up setting `outer_width` and `outer_height` to the same `width` and
`height` that get passed in to `get_available_dimensions`. I can update the
function to just use the `terminal` for those values then.
2) I initially had the function as `set_available_dimensions` but in the
`guac_terminal_resize` function we needed access to both the original
dimensions and the new dimensions from `set_available_dimensions` when the
`__guac_terminal_resize` function is called so to prevent rewriting a
significant amount of code inside `__guac_terminal_resize` I made the
`set_available_dimensions` function a get rather than a set.
--
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]