821 |
{ |
{ |
822 |
BOOL free_data = False; |
BOOL free_data = False; |
823 |
|
|
824 |
|
if (length == 0) |
825 |
|
{ |
826 |
|
xclip_refuse_selection(&selection_request); |
827 |
|
has_selection_request = False; |
828 |
|
return; |
829 |
|
} |
830 |
|
|
831 |
if (selection_request.target == format_string_atom || selection_request.target == XA_STRING) |
if (selection_request.target == format_string_atom || selection_request.target == XA_STRING) |
832 |
{ |
{ |
833 |
/* We're expecting a CF_TEXT response */ |
/* We're expecting a CF_TEXT response */ |
999 |
format_string_atom = XInternAtom(g_display, "STRING", False); |
format_string_atom = XInternAtom(g_display, "STRING", False); |
1000 |
format_utf8_string_atom = XInternAtom(g_display, "UTF8_STRING", False); |
format_utf8_string_atom = XInternAtom(g_display, "UTF8_STRING", False); |
1001 |
format_unicode_atom = XInternAtom(g_display, "text/unicode", False); |
format_unicode_atom = XInternAtom(g_display, "text/unicode", False); |
1002 |
|
|
1003 |
|
/* rdesktop sets _RDESKTOP_CLIPBOARD_FORMATS on the root window when acquiring the clipboard. |
1004 |
|
Other interested rdesktops can use this to notify their server of the available formats. */ |
1005 |
|
rdesktop_clipboard_formats_atom = |
1006 |
|
XInternAtom(g_display, "_RDESKTOP_CLIPBOARD_FORMATS", False); |
1007 |
|
XSelectInput(g_display, DefaultRootWindow(g_display), PropertyChangeMask); |
1008 |
|
|
1009 |
num_targets = 0; |
num_targets = 0; |
1010 |
targets[num_targets++] = targets_atom; |
targets[num_targets++] = targets_atom; |
1011 |
targets[num_targets++] = timestamp_atom; |
targets[num_targets++] = timestamp_atom; |
1012 |
targets[num_targets++] = rdesktop_clipboard_formats_atom; |
targets[num_targets++] = rdesktop_clipboard_formats_atom; |
|
targets[num_targets++] = format_string_atom; |
|
1013 |
#ifdef USE_UNICODE_CLIPBOARD |
#ifdef USE_UNICODE_CLIPBOARD |
1014 |
targets[num_targets++] = format_utf8_string_atom; |
targets[num_targets++] = format_utf8_string_atom; |
1015 |
#endif |
#endif |
1016 |
targets[num_targets++] = format_unicode_atom; |
targets[num_targets++] = format_unicode_atom; |
1017 |
|
targets[num_targets++] = format_string_atom; |
1018 |
targets[num_targets++] = XA_STRING; |
targets[num_targets++] = XA_STRING; |
|
|
|
|
/* rdesktop sets _RDESKTOP_CLIPBOARD_FORMATS on the root window when acquiring the clipboard. |
|
|
Other interested rdesktops can use this to notify their server of the available formats. */ |
|
|
rdesktop_clipboard_formats_atom = |
|
|
XInternAtom(g_display, "_RDESKTOP_CLIPBOARD_FORMATS", False); |
|
|
XSelectInput(g_display, DefaultRootWindow(g_display), PropertyChangeMask); |
|
1019 |
} |
} |