Store clipboard data in client data.
This commit is contained in:
parent
f57e4f05ab
commit
61ee76bf16
@ -82,6 +82,8 @@ typedef struct rdp_guac_client_data {
|
|||||||
|
|
||||||
guac_rdp_keysym_state_map keysym_state;
|
guac_rdp_keysym_state_map keysym_state;
|
||||||
|
|
||||||
|
const char* clipboard;
|
||||||
|
|
||||||
} rdp_guac_client_data;
|
} rdp_guac_client_data;
|
||||||
|
|
||||||
typedef struct rdp_freerdp_context {
|
typedef struct rdp_freerdp_context {
|
||||||
|
@ -367,6 +367,7 @@ int guac_client_init(guac_client* client, int argc, char** argv) {
|
|||||||
guac_client_data->rdp_inst = rdp_inst;
|
guac_client_data->rdp_inst = rdp_inst;
|
||||||
guac_client_data->mouse_button_mask = 0;
|
guac_client_data->mouse_button_mask = 0;
|
||||||
guac_client_data->current_surface = GUAC_DEFAULT_LAYER;
|
guac_client_data->current_surface = GUAC_DEFAULT_LAYER;
|
||||||
|
guac_client_data->clipboard = "";
|
||||||
|
|
||||||
/* Clear keysym state mapping and keymap */
|
/* Clear keysym state mapping and keymap */
|
||||||
memset(guac_client_data->keysym_state, 0,
|
memset(guac_client_data->keysym_state, 0,
|
||||||
|
@ -144,8 +144,16 @@ void guac_rdp_process_cb_data_response(guac_client* client,
|
|||||||
RDP_CB_DATA_RESPONSE_EVENT* event) {
|
RDP_CB_DATA_RESPONSE_EVENT* event) {
|
||||||
|
|
||||||
/* Received clipboard data */
|
/* Received clipboard data */
|
||||||
if (event->data[event->size - 1] == '\0')
|
if (event->data[event->size - 1] == '\0') {
|
||||||
|
|
||||||
|
/* Store clipboard data */
|
||||||
|
((rdp_guac_client_data*) client->data)->clipboard =
|
||||||
|
strdup((char*) event->data);
|
||||||
|
|
||||||
|
/* Send clipboard data */
|
||||||
guac_protocol_send_clipboard(client->socket, (char*) event->data);
|
guac_protocol_send_clipboard(client->socket, (char*) event->data);
|
||||||
|
|
||||||
|
}
|
||||||
else
|
else
|
||||||
guac_client_log_error(client,
|
guac_client_log_error(client,
|
||||||
"Clipboard data missing null terminator");
|
"Clipboard data missing null terminator");
|
||||||
|
Loading…
Reference in New Issue
Block a user