void guac_rdp_gdi_desktop_resize(rdpContext* context) { guac_client* client = ((rdp_freerdp_context*) context)->client; rdp_guac_client_data* data = (rdp_guac_client_data*) client->data; guac_common_surface_resize(data->default_surface, guac_rdp_get_width(context->instance), guac_rdp_get_height(context->instance)); guac_common_surface_reset_clip(data->default_surface); guac_client_log(client, GUAC_LOG_DEBUG, "Server resized display to %ix%i", guac_rdp_get_width(context->instance), guac_rdp_get_height(context->instance)); }
void guac_terminal_display_resize(guac_terminal_display* display, int width, int height) { guac_terminal_operation* current; int x, y; /* Fill with background color */ guac_terminal_char fill = { .value = 0, .attributes = { .foreground = display->default_background, .background = display->default_background }, .width = 1 }; /* Free old operations buffer */ if (display->operations != NULL) free(display->operations); /* Alloc operations */ display->operations = malloc(width * height * sizeof(guac_terminal_operation)); /* Init each operation buffer row */ current = display->operations; for (y=0; y<height; y++) { /* Init entire row to NOP */ for (x=0; x<width; x++) { /* If on old part of screen, do not clear */ if (x < display->width && y < display->height) current->type = GUAC_CHAR_NOP; /* Otherwise, clear contents first */ else { current->type = GUAC_CHAR_SET; current->character = fill; } current++; } } /* Set width and height */ display->width = width; display->height = height; /* Send display size */ guac_common_surface_resize( display->display_surface, display->char_width * width, display->char_height * height); guac_protocol_send_size(display->client->socket, display->select_layer, display->char_width * width, display->char_height * height); /* If selection visible and committed, clear */ if (display->text_selected && display->selection_committed) __guac_terminal_display_clear_select(display); }