Exemplo n.º 1
0
void guac_rdp_gdi_set_bounds(rdpContext* context, rdpBounds* bounds) {

    guac_client* client = ((rdp_freerdp_context*) context)->client;
    const guac_layer* current_layer = ((rdp_guac_client_data*) client->data)->current_surface;

    /* Reset clip */
    guac_protocol_send_reset(client->socket, current_layer);

    /* Set clip if specified */
    if (bounds != NULL) {
        guac_protocol_send_rect(client->socket, current_layer,
                bounds->left, bounds->top,
                bounds->right - bounds->left + 1,
                bounds->bottom - bounds->top + 1);

        guac_protocol_send_clip(client->socket, current_layer);
    }

    /* If no bounds given, clear bounding rect */
    if (bounds == NULL)
        ((rdp_guac_client_data*)client->data)->bounded = false;

    /* Otherwise, set bounding rectangle */
    else {
        ((rdp_guac_client_data*)client->data)->bounded = true;
        ((rdp_guac_client_data*)client->data)->bounds_left   = bounds->left;
        ((rdp_guac_client_data*)client->data)->bounds_top    = bounds->top;
        ((rdp_guac_client_data*)client->data)->bounds_right  = bounds->right;
        ((rdp_guac_client_data*)client->data)->bounds_bottom = bounds->bottom;    
    }

}
Exemplo n.º 2
0
void guac_rdp_gdi_set_bounds(rdpContext* context, rdpBounds* bounds) {

    guac_client* client = ((rdp_freerdp_context*) context)->client;
    const guac_layer* current_layer = ((rdp_guac_client_data*) client->data)->current_surface;

    rdp_guac_client_data* data = (rdp_guac_client_data*) client->data;
    pthread_mutex_lock(&(data->update_lock));

    /* Reset clip */
    guac_protocol_send_reset(client->socket, current_layer);

    /* Set clip if specified */
    if (bounds != NULL) {
        guac_protocol_send_rect(client->socket, current_layer,
                bounds->left, bounds->top,
                bounds->right - bounds->left + 1,
                bounds->bottom - bounds->top + 1);

        guac_protocol_send_clip(client->socket, current_layer);
    }

    pthread_mutex_unlock(&(data->update_lock));

}