mirror of
https://github.com/FreeRDP/FreeRDP.git
synced 2025-06-03 00:00:20 +00:00
[client,x11] always only send available clipboard
This commit is contained in:
parent
e3f660e11f
commit
4545783dff
@ -1642,8 +1642,6 @@ static UINT xf_cliprdr_send_client_capabilities(xfClipboard* clipboard)
|
|||||||
*/
|
*/
|
||||||
static UINT xf_cliprdr_send_client_format_list(xfClipboard* clipboard, BOOL force)
|
static UINT xf_cliprdr_send_client_format_list(xfClipboard* clipboard, BOOL force)
|
||||||
{
|
{
|
||||||
UINT32 numFormats;
|
|
||||||
CLIPRDR_FORMAT* formats = NULL;
|
|
||||||
UINT ret;
|
UINT ret;
|
||||||
xfContext* xfc;
|
xfContext* xfc;
|
||||||
|
|
||||||
@ -1651,27 +1649,11 @@ static UINT xf_cliprdr_send_client_format_list(xfClipboard* clipboard, BOOL forc
|
|||||||
|
|
||||||
xfc = clipboard->xfc;
|
xfc = clipboard->xfc;
|
||||||
WINPR_ASSERT(xfc);
|
WINPR_ASSERT(xfc);
|
||||||
numFormats = clipboard->numClientFormats;
|
|
||||||
|
|
||||||
if (numFormats)
|
UINT32 numFormats = 0;
|
||||||
{
|
CLIPRDR_FORMAT* formats = xf_cliprdr_get_client_formats(clipboard, &numFormats);
|
||||||
if (!(formats = (CLIPRDR_FORMAT*)calloc(numFormats, sizeof(CLIPRDR_FORMAT))))
|
|
||||||
{
|
|
||||||
WLog_ERR(TAG, "failed to allocate %" PRIu32 " CLIPRDR_FORMAT structs", numFormats);
|
|
||||||
return CHANNEL_RC_NO_MEMORY;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (size_t i = 0; i < numFormats; i++)
|
|
||||||
{
|
|
||||||
const xfCliprdrFormat* clientFormat = &clipboard->clientFormats[i];
|
|
||||||
CLIPRDR_FORMAT* format = &formats[i];
|
|
||||||
format->formatId = clientFormat->formatToRequest;
|
|
||||||
format->formatName = clientFormat->formatName;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = xf_cliprdr_send_format_list(clipboard, formats, numFormats, force);
|
ret = xf_cliprdr_send_format_list(clipboard, formats, numFormats, force);
|
||||||
free(formats);
|
|
||||||
|
|
||||||
if (clipboard->owner && clipboard->owner != xfc->drawable)
|
if (clipboard->owner && clipboard->owner != xfc->drawable)
|
||||||
{
|
{
|
||||||
@ -1680,6 +1662,8 @@ static UINT xf_cliprdr_send_client_format_list(xfClipboard* clipboard, BOOL forc
|
|||||||
clipboard->property_atom, xfc->drawable, CurrentTime);
|
clipboard->property_atom, xfc->drawable, CurrentTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xf_cliprdr_free_formats(formats, numFormats);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user