From c39118be7ec9adac82ed41e87e5a4f85269f7392 Mon Sep 17 00:00:00 2001 From: Hardening Date: Wed, 22 May 2013 23:40:19 +0200 Subject: [PATCH] rdp: Don't rely on Synchronize packet for first screen refresh Last FreeRDP don't send Synchronize packets anymore, so send the first screen refresh when we're "connected". The client cursor is also disabled during this step. --- src/compositor-rdp.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/compositor-rdp.c b/src/compositor-rdp.c index eb43f598..d19b448b 100644 --- a/src/compositor-rdp.c +++ b/src/compositor-rdp.c @@ -640,10 +640,14 @@ xf_peer_post_connect(freerdp_peer* client) struct rdp_compositor *c; struct rdp_output *output; rdpSettings *settings; + rdpPointerUpdate *pointer; struct xkb_context *xkbContext; struct xkb_rule_names xkbRuleNames; struct xkb_keymap *keymap; int i; + pixman_box32_t box; + pixman_region32_t damage; + peerCtx = (RdpPeerContext *)client->context; c = peerCtx->rdpCompositor; @@ -697,6 +701,23 @@ xf_peer_post_connect(freerdp_peer* client) weston_seat_init_pointer(&peerCtx->item.seat); peerCtx->item.flags |= RDP_PEER_ACTIVATED; + + /* disable pointer on the client side */ + pointer = client->update->pointer; + pointer->pointer_system.type = SYSPTR_NULL; + pointer->PointerSystem(client->context, &pointer->pointer_system); + + /* sends a full refresh */ + box.x1 = 0; + box.y1 = 0; + box.x2 = output->base.width; + box.y2 = output->base.height; + pixman_region32_init_with_extents(&damage, &box); + + rdp_peer_refresh_region(&damage, client); + + pixman_region32_fini(&damage); + return TRUE; } @@ -759,16 +780,11 @@ static void xf_input_synchronize_event(rdpInput *input, UINT32 flags) { freerdp_peer *client = input->context->peer; - rdpPointerUpdate *pointer = client->update->pointer; RdpPeerContext *peerCtx = (RdpPeerContext *)input->context; struct rdp_output *output = peerCtx->rdpCompositor->output; pixman_box32_t box; pixman_region32_t damage; - /* disable pointer on the client side */ - pointer->pointer_system.type = SYSPTR_NULL; - pointer->PointerSystem(client->context, &pointer->pointer_system); - /* sends a full refresh */ box.x1 = 0; box.y1 = 0;