20 |
|
|
21 |
#include <X11/Xlib.h> |
#include <X11/Xlib.h> |
22 |
#include <X11/Xatom.h> |
#include <X11/Xatom.h> |
23 |
|
#include <sys/time.h> |
24 |
|
#include <sys/types.h> |
25 |
|
#include <unistd.h> |
26 |
#include "rdesktop.h" |
#include "rdesktop.h" |
27 |
|
|
28 |
extern BOOL encryption; |
extern BOOL encryption; |
83 |
cliprdr_send_format_announce(void) |
cliprdr_send_format_announce(void) |
84 |
{ |
{ |
85 |
STREAM s; |
STREAM s; |
|
|
|
|
DEBUG_CLIPBOARD(("Sending (empty) format announce\n")); |
|
86 |
int number_of_formats = 1; |
int number_of_formats = 1; |
87 |
|
DEBUG_CLIPBOARD(("Sending (empty) format announce\n")); |
88 |
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); |
89 |
out_uint32_le(s, number_of_formats * 36 + 12); |
out_uint32_le(s, number_of_formats * 36 + 12); |
90 |
out_uint32_le(s, 0x13); |
out_uint32_le(s, 0x13); |
313 |
|
|
314 |
|
|
315 |
XFree(data); |
XFree(data); |
316 |
if (!rdesktop_clipboard_target_atom) |
if (!rdesktop_is_selection_owner) |
317 |
cliprdr_send_format_announce(); |
cliprdr_send_format_announce(); |
318 |
|
|
319 |
} |
} |
636 |
} |
} |
637 |
else |
else |
638 |
{ |
{ |
|
DEBUG_CLIPBOARD(("There were no owner for PRIMARY, sending empty string\n")); // FIXME: Should we always send an empty string? |
|
639 |
|
|
640 |
cliprdr_send_empty_datapacket(); |
selectionowner = XGetSelectionOwner(display, clipboard_atom); |
641 |
|
if (None != selectionowner) |
642 |
|
{ |
643 |
|
XConvertSelection(display, clipboard_atom, |
644 |
|
targets_atom, |
645 |
|
rdesktop_clipboard_target_atom, wnd, CurrentTime); |
646 |
|
|
647 |
|
/* The rest of the transfer is handled in |
648 |
|
cliprdr_handle_SelectionNotify */ |
649 |
|
|
650 |
|
} |
651 |
|
else |
652 |
|
{ |
653 |
|
|
654 |
|
DEBUG_CLIPBOARD(("There were no owner for PRIMARY nor CLIPBOARD, sending empty string\n")); // FIXME: Should we always send an empty string? |
655 |
|
|
656 |
|
cliprdr_send_empty_datapacket(); |
657 |
|
} |
658 |
} |
} |
659 |
|
|
660 |
|
|