eugen-keeper commented on code in PR #597:
URL: https://github.com/apache/guacamole-server/pull/597#discussion_r2124884051


##########
src/terminal/terminal.c:
##########
@@ -868,6 +868,14 @@ void guac_terminal_scroll_up(guac_terminal* term,
 void guac_terminal_scroll_down(guac_terminal* term,
         int start_row, int end_row, int amount) {
 
+    /*
+     * This is necessary because guac_terminal_copy_rows will set new 
GUAC_CHAR_COPY
+     * for cells of shifted rows meanwhile preceding GUAC_CHAR_SET for these 
cells
+     * are not actually done yet. The GUAC_CHAR_COPY operation has the highest 
priority,
+     * so if we do not 'flush' here, wrong content will be copied.
+     */
+    guac_terminal_display_flush(term->display);

Review Comment:
   I performed the research sometime ago. Even after I did it, I was confused a 
little about the behavior because we have mix of numbers and images there. It 
was difficult to simply sample frames or dump rows to understand every details. 
Anyway, I remember the following things.
   1. `guac_common_surface_flush` is actually not necessary, the following 
calls are necessary:
   - `__guac_terminal_display_flush_copy`
   - `__guac_terminal_display_flush_clear`
   - `__guac_terminal_display_flush_set`
   2. Based on my research the solution could be `set` before 
`guac_terminal_copy_rows` and copy/clear at the end of 
`guac_terminal_scroll_down`. Although performing all the operations 
`guac_terminal_copy_rows` also helps 100%. Tested!
   3.  I would prefer to avoid making changes inside `guac_terminal_copy_rows` 
because the issue happens only during `scrolling down` because the first line 
is set with new characters and then we have to copy them to one of the next 
lines. 
   4. Overall, no matter how I tried to fix it a different way, as far as 
remember I found that the best solution is to flush between preceding `set` 
operations and guac_terminal_display_copy_rows.



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