GUACAMOLE-2063: Decouple render thread updates from FreeRDP GDI updates.

Doing otherwise tends to result in slower RDP updates being flushed as
frames, amplifying the slowdown of those updates.
This commit is contained in:
Michael Jumper 2025-05-13 10:45:06 -07:00
parent 50f5b5f937
commit fe35de5459
No known key found for this signature in database
GPG Key ID: 5B2977AEE5E4518F
3 changed files with 14 additions and 1 deletions

View File

@ -134,7 +134,7 @@ BOOL guac_rdp_gdi_end_paint(rdpContext* context) {
guac_rect_constrain(&dst_rect, &current_context->bounds);
guac_rect_extend(&current_context->dirty, &dst_rect);
guac_display_render_thread_notify_modified(rdp_client->render_thread);
rdp_client->gdi_modified = 1;
paint_complete:

View File

@ -617,6 +617,13 @@ static int guac_rdp_handle_connection(guac_client* client) {
if (!guac_rdp_handle_events(rdp_client))
wait_result = -1;
/* Notify display of any changes to the GDI that may have occurred
* while handling events/messages */
if (rdp_client->gdi_modified) {
guac_display_render_thread_notify_modified(rdp_client->render_thread);
rdp_client->gdi_modified = 0;
}
/* Test whether the RDP server is closing the connection */
int connection_closing;
#ifdef HAVE_DISCONNECT_CONTEXT

View File

@ -114,6 +114,12 @@ typedef struct guac_rdp_client {
*/
guac_display_layer_raw_context* current_context;
/**
* Whether the graphical state of FreeRDP's GDI has changed since the last
* time a frame was sent to the client.
*/
int gdi_modified;
/**
* The current instance of the guac_display render thread. If the thread
* has not yet been started, this will be NULL.