104 |
XSendEvent(g_display, req->requestor, False, NoEventMask, &xev); |
XSendEvent(g_display, req->requestor, False, NoEventMask, &xev); |
105 |
} |
} |
106 |
|
|
107 |
|
#ifndef MAKE_PROTO |
108 |
void |
void |
109 |
xclip_handle_SelectionNotify(XSelectionEvent * event) |
xclip_handle_SelectionNotify(XSelectionEvent * event) |
110 |
{ |
{ |
192 |
translated_data = lf2crlf(data, &length); |
translated_data = lf2crlf(data, &length); |
193 |
|
|
194 |
g_clip_buffer = (uint8 *) xmalloc(length); |
g_clip_buffer = (uint8 *) xmalloc(length); |
195 |
strncpy(g_clip_buffer, translated_data, length); |
strncpy((char *) g_clip_buffer, (char *) translated_data, length); |
196 |
xfree(translated_data); |
xfree(translated_data); |
197 |
g_clip_buflen = length; |
g_clip_buflen = length; |
198 |
|
|
220 |
XFree(data); |
XFree(data); |
221 |
|
|
222 |
if (!rdesktop_is_selection_owner) |
if (!rdesktop_is_selection_owner) |
223 |
cliprdr_send_text_format_announce(); |
cliprdr_send_simple_native_format_announce(CF_TEXT); |
224 |
return; |
return; |
225 |
|
|
226 |
fail: |
fail: |
276 |
DEBUG_CLIPBOARD(("xclip_handle_SelectionClear\n")); |
DEBUG_CLIPBOARD(("xclip_handle_SelectionClear\n")); |
277 |
have_primary = 0; |
have_primary = 0; |
278 |
XDeleteProperty(g_display, DefaultRootWindow(g_display), rdesktop_clipboard_formats_atom); |
XDeleteProperty(g_display, DefaultRootWindow(g_display), rdesktop_clipboard_formats_atom); |
279 |
cliprdr_send_text_format_announce(); |
cliprdr_send_simple_native_format_announce(CF_TEXT); |
280 |
} |
} |
281 |
|
|
282 |
void |
void |
311 |
cliprdr_send_data(g_clip_buffer, g_clip_buflen + 1); |
cliprdr_send_data(g_clip_buffer, g_clip_buflen + 1); |
312 |
|
|
313 |
if (!rdesktop_is_selection_owner) |
if (!rdesktop_is_selection_owner) |
314 |
cliprdr_send_text_format_announce(); |
cliprdr_send_simple_native_format_announce(CF_TEXT); |
315 |
|
|
316 |
xfree(g_clip_buffer); |
xfree(g_clip_buffer); |
317 |
g_clip_buffer = 0; |
g_clip_buffer = 0; |
322 |
{ |
{ |
323 |
uint8 *translated_data; |
uint8 *translated_data; |
324 |
uint32 length = nitems; |
uint32 length = nitems; |
325 |
|
uint8 *tmp; |
326 |
|
|
327 |
DEBUG_CLIPBOARD(("Translating linebreaks before sending data\n")); |
DEBUG_CLIPBOARD(("Translating linebreaks before sending data\n")); |
328 |
translated_data = lf2crlf(data, &length); |
translated_data = lf2crlf(data, &length); |
329 |
|
|
330 |
uint8 *tmp = xmalloc(length + g_clip_buflen); |
tmp = xmalloc(length + g_clip_buflen); |
331 |
strncpy(tmp, g_clip_buffer, g_clip_buflen); |
strncpy((char *) tmp, (char *) g_clip_buffer, g_clip_buflen); |
332 |
xfree(g_clip_buffer); |
xfree(g_clip_buffer); |
333 |
|
|
334 |
strncpy(tmp + g_clip_buflen, translated_data, length); |
strncpy((char *) (tmp + g_clip_buflen), (char *) translated_data, length); |
335 |
xfree(translated_data); |
xfree(translated_data); |
336 |
|
|
337 |
g_clip_buffer = tmp; |
g_clip_buffer = tmp; |
364 |
} |
} |
365 |
|
|
366 |
/* PropertyDelete, or XGetWindowProperty failed */ |
/* PropertyDelete, or XGetWindowProperty failed */ |
367 |
cliprdr_send_text_format_announce(); |
cliprdr_send_simple_native_format_announce(CF_TEXT); |
368 |
rdesktop_is_selection_owner = 0; |
rdesktop_is_selection_owner = 0; |
369 |
} |
} |
370 |
|
#endif |
371 |
|
|
372 |
|
|
373 |
void |
void |
453 |
void |
void |
454 |
ui_clip_sync(void) |
ui_clip_sync(void) |
455 |
{ |
{ |
456 |
cliprdr_send_text_format_announce(); |
cliprdr_send_simple_native_format_announce(CF_TEXT); |
457 |
} |
} |
458 |
|
|
459 |
|
|