GUACAMOLE-377: Add frame boundaries around cursor set operations if otherwise absent.

This commit is contained in:
Michael Jumper 2022-06-06 09:32:36 -07:00
parent b7f05b9e4f
commit ce27936ed5

View File

@ -21,6 +21,7 @@
#include "common/cursor.h"
#include "common/display.h"
#include "common/surface.h"
#include "gdi.h"
#include "pointer.h"
#include "rdp.h"
@ -78,11 +79,22 @@ BOOL guac_rdp_pointer_set(rdpContext* context, const rdpPointer* pointer) {
guac_client* client = ((rdp_freerdp_context*) context)->client;
guac_rdp_client* rdp_client = (guac_rdp_client*) client->data;
/* Add explicit frame boundaries around cursor set operation if not already
* in a frame (the RDP protocol does not send nor expect frame boundaries
* for cursor changes, but Guacamole does expect this) */
int in_frame = rdp_client->in_frame;
if (rdp_client->frames_supported && !in_frame)
guac_rdp_gdi_mark_frame(context, 1);
/* Set cursor */
guac_common_cursor_set_surface(rdp_client->display->cursor,
pointer->xPos, pointer->yPos,
((guac_rdp_pointer*) pointer)->layer->surface);
if (rdp_client->frames_supported && !in_frame)
guac_rdp_gdi_mark_frame(context, 0);
return TRUE;
}
@ -106,9 +118,20 @@ BOOL guac_rdp_pointer_set_null(rdpContext* context) {
guac_client* client = ((rdp_freerdp_context*) context)->client;
guac_rdp_client* rdp_client = (guac_rdp_client*) client->data;
/* Add explicit frame boundaries around cursor set operation if not already
* in a frame (the RDP protocol does not send nor expect frame boundaries
* for cursor changes, but Guacamole does expect this) */
int in_frame = rdp_client->in_frame;
if (rdp_client->frames_supported && !in_frame)
guac_rdp_gdi_mark_frame(context, 1);
/* Set cursor to empty/blank graphic */
guac_common_cursor_set_blank(rdp_client->display->cursor);
if (rdp_client->frames_supported && !in_frame)
guac_rdp_gdi_mark_frame(context, 0);
return TRUE;
}
@ -118,9 +141,20 @@ BOOL guac_rdp_pointer_set_default(rdpContext* context) {
guac_client* client = ((rdp_freerdp_context*) context)->client;
guac_rdp_client* rdp_client = (guac_rdp_client*) client->data;
/* Add explicit frame boundaries around cursor set operation if not already
* in a frame (the RDP protocol does not send nor expect frame boundaries
* for cursor changes, but Guacamole does expect this) */
int in_frame = rdp_client->in_frame;
if (rdp_client->frames_supported && !in_frame)
guac_rdp_gdi_mark_frame(context, 1);
/* Set cursor to embedded pointer */
guac_common_cursor_set_pointer(rdp_client->display->cursor);
if (rdp_client->frames_supported && !in_frame)
guac_rdp_gdi_mark_frame(context, 0);
return TRUE;
}