133 |
xclip_handle_SelectionRequest(XSelectionRequestEvent * event) |
xclip_handle_SelectionRequest(XSelectionRequestEvent * event) |
134 |
{ |
{ |
135 |
unsigned long nitems, bytes_left; |
unsigned long nitems, bytes_left; |
136 |
|
unsigned char *prop_return; |
137 |
uint32 *wanted_format; |
uint32 *wanted_format; |
138 |
int format, res; |
int format, res; |
139 |
Atom type; |
Atom type; |
157 |
{ |
{ |
158 |
res = XGetWindowProperty(g_display, event->requestor, |
res = XGetWindowProperty(g_display, event->requestor, |
159 |
rdesktop_clipboard_target_atom, 0, 1, True, XA_INTEGER, |
rdesktop_clipboard_target_atom, 0, 1, True, XA_INTEGER, |
160 |
&type, &format, &nitems, &bytes_left, |
&type, &format, &nitems, &bytes_left, &prop_return); |
161 |
(unsigned char **) &wanted_format); |
wanted_format = (uint32 *) prop_return; |
162 |
format = (res == Success) ? *wanted_format : CF_TEXT; |
format = (res == Success) ? *wanted_format : CF_TEXT; |
163 |
|
/* FIXME: Need to free returned data? */ |
164 |
} |
} |
165 |
else |
else |
166 |
{ |
{ |
217 |
|
|
218 |
|
|
219 |
void |
void |
220 |
ui_clip_format_announce(char *data, uint32 length) |
ui_clip_format_announce(uint8 * data, uint32 length) |
221 |
{ |
{ |
222 |
XSetSelectionOwner(g_display, primary_atom, g_wnd, g_last_gesturetime); |
XSetSelectionOwner(g_display, primary_atom, g_wnd, g_last_gesturetime); |
223 |
if (XGetSelectionOwner(g_display, primary_atom) != g_wnd) |
if (XGetSelectionOwner(g_display, primary_atom) != g_wnd) |
238 |
|
|
239 |
|
|
240 |
void |
void |
241 |
ui_clip_handle_data(char *data, uint32 length) |
ui_clip_handle_data(uint8 * data, uint32 length) |
242 |
{ |
{ |
243 |
xclip_provide_selection(&selection_request, XA_STRING, 8, data, length - 1); |
xclip_provide_selection(&selection_request, XA_STRING, 8, data, length - 1); |
244 |
} |
} |