78 |
static void |
static void |
79 |
cliprdr_send_format_announce(void) |
cliprdr_send_format_announce(void) |
80 |
{ |
{ |
|
DEBUG_CLIPBOARD(("Sending (empty) format announce\n")); |
|
|
|
|
81 |
STREAM s; |
STREAM s; |
82 |
|
|
83 |
|
DEBUG_CLIPBOARD(("Sending (empty) format announce\n")); |
84 |
int number_of_formats = 1; |
int number_of_formats = 1; |
85 |
s = sec_init(encryption ? SEC_ENCRYPT : 0, number_of_formats*36+12+4+4); |
s = sec_init(encryption ? SEC_ENCRYPT : 0, number_of_formats*36+12+4+4); |
86 |
out_uint32_le(s, number_of_formats*36+12); |
out_uint32_le(s, number_of_formats*36+12); |
247 |
return; |
return; |
248 |
} |
} |
249 |
|
|
|
DEBUG_CLIPBOARD(("Received %d bytes of clipboard data from X, there is %d remaining\n", |
|
|
nitems, bytes_left)); |
|
|
DEBUG_CLIPBOARD(("type_return is %s\n", |
|
|
XGetAtomName(display, type_return))); |
|
|
|
|
250 |
datap = data; |
datap = data; |
251 |
|
|
252 |
if (nitems+1 <= MAX_CLIPRDR_STANDALONE_DATASIZE) |
if (nitems+1 <= MAX_CLIPRDR_STANDALONE_DATASIZE) |
306 |
datap+=MAX_CLIPRDR_CONTINUATION_DATASIZE; |
datap+=MAX_CLIPRDR_CONTINUATION_DATASIZE; |
307 |
|
|
308 |
} |
} |
309 |
DEBUG_CLIPBOARD(("Sending %d bytes of data\n", |
DEBUG_CLIPBOARD(("Sending %u bytes of data\n", |
310 |
12+bytes_left_to_transfer)); |
12+bytes_left_to_transfer)); |
311 |
out = sec_init(encryption ? SEC_ENCRYPT : 0, |
out = sec_init(encryption ? SEC_ENCRYPT : 0, |
312 |
12+bytes_left_to_transfer); |
12+bytes_left_to_transfer); |
368 |
{ |
{ |
369 |
|
|
370 |
XSelectionEvent xev; |
XSelectionEvent xev; |
|
unsigned char *data; |
|
371 |
unsigned long nitems, bytes_left; |
unsigned long nitems, bytes_left; |
372 |
Atom type_return; |
Atom type_return; |
373 |
uint32 *wanted_formatcode; |
uint32 *wanted_formatcode; |
411 |
&format, |
&format, |
412 |
&nitems, |
&nitems, |
413 |
&bytes_left, |
&bytes_left, |
414 |
&wanted_formatcode); |
(unsigned char **)&wanted_formatcode); |
415 |
DEBUG_CLIPBOARD(("Got wanted formatcode %d, format is %d\n", *wanted_formatcode, format)); |
DEBUG_CLIPBOARD(("Got wanted formatcode %d, format is %d\n", *wanted_formatcode, format)); |
416 |
cliprdr_request_clipboard_data(*wanted_formatcode); |
cliprdr_request_clipboard_data(*wanted_formatcode); |
417 |
} |
} |
436 |
return; |
return; |
437 |
} else if (timestamp_atom == xevent->target) |
} else if (timestamp_atom == xevent->target) |
438 |
{ |
{ |
439 |
|
DEBUG_CLIPBOARD(("Sending TIMESTAMP\n")); |
440 |
XChangeProperty(display, |
XChangeProperty(display, |
441 |
xevent->requestor, |
xevent->requestor, |
442 |
xevent->property, |
xevent->property, |
600 |
bytes_left_to_read)); |
bytes_left_to_read)); |
601 |
memcpy(datap, s->p, bytes_left_to_read); |
memcpy(datap, s->p, bytes_left_to_read); |
602 |
} |
} |
603 |
|
DEBUG_CLIPBOARD(("Setting target atom (%s) on %d\n", |
604 |
|
XGetAtomName(display, selection_event.property), |
605 |
|
selection_event.requestor)); |
606 |
XChangeProperty(display, |
XChangeProperty(display, |
607 |
selection_event.requestor, |
selection_event.requestor, |
608 |
selection_event.property, |
selection_event.property, |
642 |
|
|
643 |
if (rdesktop_is_selection_owner) |
if (rdesktop_is_selection_owner) |
644 |
{ |
{ |
645 |
|
DEBUG_CLIPBOARD(("XChangeProperty, rdesktop_is_selection_owner\n")); |
646 |
XChangeProperty(display, wnd, rdesktop_clipboard_target_atom, |
XChangeProperty(display, wnd, rdesktop_clipboard_target_atom, |
647 |
XA_INTEGER, 32, PropModeReplace, |
XA_INTEGER, 32, PropModeReplace, |
648 |
(unsigned char *)&wanted_formatcode, 1); |
(unsigned char *)&wanted_formatcode, 1); |