rdp: Don't rely on Synchronize packet for first screen refresh
authorHardening <rdp.effort@gmail.com>
Wed, 22 May 2013 21:40:19 +0000 (23:40 +0200)
committerKristian Høgsberg <krh@bitplanet.net>
Thu, 23 May 2013 01:53:58 +0000 (21:53 -0400)
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

index eb43f59..d19b448 100644 (file)
@@ -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;