Applied patch 1349027 by Ilya Konstantinov.
Generalizes code for sending clipboard format announces to RDP side, and uses new code in appropriate places. git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1024 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
parent
537d94dd76
commit
95f19ad209
31
cliprdr.c
31
cliprdr.c
@ -50,30 +50,29 @@ cliprdr_send_packet(uint16 type, uint16 status, uint8 * data, uint32 length)
|
|||||||
channel_send(s, cliprdr_channel);
|
channel_send(s, cliprdr_channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Helper which announces our readiness to supply clipboard data
|
||||||
|
in a single format (such as CF_TEXT) to the RDP side.
|
||||||
|
To announce more than one format at a time, use
|
||||||
|
cliprdr_send_native_format_announce.
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
cliprdr_send_text_format_announce(void)
|
cliprdr_send_simple_native_format_announce(uint32 format)
|
||||||
{
|
{
|
||||||
uint8 buffer[36];
|
uint8 buffer[36];
|
||||||
|
|
||||||
buf_out_uint32(buffer, CF_TEXT);
|
buf_out_uint32(buffer, format);
|
||||||
memset(buffer + 4, 0, sizeof(buffer) - 4); /* description */
|
memset(buffer + 4, 0, sizeof(buffer) - 4); /* description */
|
||||||
cliprdr_send_packet(CLIPRDR_FORMAT_ANNOUNCE, CLIPRDR_REQUEST, buffer, sizeof(buffer));
|
cliprdr_send_native_format_announce(buffer, sizeof(buffer));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Announces our readiness to supply clipboard data in multiple
|
||||||
|
formats, each denoted by a 36-byte format descriptor of
|
||||||
|
[ uint32 format + 32-byte description ].
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
cliprdr_send_blah_format_announce(void)
|
cliprdr_send_native_format_announce(uint8 * formats_data, uint32 formats_data_length)
|
||||||
{
|
{
|
||||||
uint8 buffer[36];
|
cliprdr_send_packet(CLIPRDR_FORMAT_ANNOUNCE, CLIPRDR_REQUEST, formats_data, formats_data_length);
|
||||||
|
|
||||||
buf_out_uint32(buffer, CF_OEMTEXT);
|
|
||||||
memset(buffer + 4, 0, sizeof(buffer) - 4); /* description */
|
|
||||||
cliprdr_send_packet(CLIPRDR_FORMAT_ANNOUNCE, CLIPRDR_REQUEST, buffer, sizeof(buffer));
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
cliprdr_send_native_format_announce(uint8 * data, uint32 length)
|
|
||||||
{
|
|
||||||
cliprdr_send_packet(CLIPRDR_FORMAT_ANNOUNCE, CLIPRDR_REQUEST, data, length);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -111,7 +110,7 @@ cliprdr_process(STREAM s)
|
|||||||
{
|
{
|
||||||
/* FIXME: We seem to get this when we send an announce while the server is
|
/* FIXME: We seem to get this when we send an announce while the server is
|
||||||
still processing a paste. Try sending another announce. */
|
still processing a paste. Try sending another announce. */
|
||||||
cliprdr_send_text_format_announce();
|
cliprdr_send_simple_native_format_announce(CF_TEXT);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
5
proto.h
5
proto.h
@ -50,9 +50,8 @@ STREAM channel_init(VCHANNEL * channel, uint32 length);
|
|||||||
void channel_send(STREAM s, VCHANNEL * channel);
|
void channel_send(STREAM s, VCHANNEL * channel);
|
||||||
void channel_process(STREAM s, uint16 mcs_channel);
|
void channel_process(STREAM s, uint16 mcs_channel);
|
||||||
/* cliprdr.c */
|
/* cliprdr.c */
|
||||||
void cliprdr_send_text_format_announce(void);
|
void cliprdr_send_native_format_announce(uint8 * formats_data, uint32 formats_data_length);
|
||||||
void cliprdr_send_blah_format_announce(void);
|
void cliprdr_send_simple_native_format_announce(uint32 format);
|
||||||
void cliprdr_send_native_format_announce(uint8 * data, uint32 length);
|
|
||||||
void cliprdr_send_data_request(uint32 format);
|
void cliprdr_send_data_request(uint32 format);
|
||||||
void cliprdr_send_data(uint8 * data, uint32 length);
|
void cliprdr_send_data(uint8 * data, uint32 length);
|
||||||
BOOL cliprdr_init(void);
|
BOOL cliprdr_init(void);
|
||||||
|
10
xclip.c
10
xclip.c
@ -220,7 +220,7 @@ xclip_handle_SelectionNotify(XSelectionEvent * event)
|
|||||||
XFree(data);
|
XFree(data);
|
||||||
|
|
||||||
if (!rdesktop_is_selection_owner)
|
if (!rdesktop_is_selection_owner)
|
||||||
cliprdr_send_text_format_announce();
|
cliprdr_send_simple_native_format_announce(CF_TEXT);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
@ -276,7 +276,7 @@ xclip_handle_SelectionClear(void)
|
|||||||
DEBUG_CLIPBOARD(("xclip_handle_SelectionClear\n"));
|
DEBUG_CLIPBOARD(("xclip_handle_SelectionClear\n"));
|
||||||
have_primary = 0;
|
have_primary = 0;
|
||||||
XDeleteProperty(g_display, DefaultRootWindow(g_display), rdesktop_clipboard_formats_atom);
|
XDeleteProperty(g_display, DefaultRootWindow(g_display), rdesktop_clipboard_formats_atom);
|
||||||
cliprdr_send_text_format_announce();
|
cliprdr_send_simple_native_format_announce(CF_TEXT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -311,7 +311,7 @@ xclip_handle_PropertyNotify(XPropertyEvent * event)
|
|||||||
cliprdr_send_data(g_clip_buffer, g_clip_buflen + 1);
|
cliprdr_send_data(g_clip_buffer, g_clip_buflen + 1);
|
||||||
|
|
||||||
if (!rdesktop_is_selection_owner)
|
if (!rdesktop_is_selection_owner)
|
||||||
cliprdr_send_text_format_announce();
|
cliprdr_send_simple_native_format_announce(CF_TEXT);
|
||||||
|
|
||||||
xfree(g_clip_buffer);
|
xfree(g_clip_buffer);
|
||||||
g_clip_buffer = 0;
|
g_clip_buffer = 0;
|
||||||
@ -364,7 +364,7 @@ xclip_handle_PropertyNotify(XPropertyEvent * event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* PropertyDelete, or XGetWindowProperty failed */
|
/* PropertyDelete, or XGetWindowProperty failed */
|
||||||
cliprdr_send_text_format_announce();
|
cliprdr_send_simple_native_format_announce(CF_TEXT);
|
||||||
rdesktop_is_selection_owner = 0;
|
rdesktop_is_selection_owner = 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -453,7 +453,7 @@ ui_clip_request_data(uint32 format)
|
|||||||
void
|
void
|
||||||
ui_clip_sync(void)
|
ui_clip_sync(void)
|
||||||
{
|
{
|
||||||
cliprdr_send_text_format_announce();
|
cliprdr_send_simple_native_format_announce(CF_TEXT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user