Commit b9527511 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winex11: Pass window property to server in 64KB chunks.

Large clipboard contents, like images, can exceed the maximum X request size if sent all at once, which can cause the X server to kill the connection.
parent 84f6bb3e
......@@ -3227,11 +3227,20 @@ static void X11DRV_HandleSelectionRequest( HWND hWnd, XSelectionRequestEvent *ev
if (hClipData && (lpClipData = GlobalLock(hClipData)))
{
int mode = PropModeReplace;
TRACE("\tUpdating property %s, %d bytes\n", debugstr_w(lpFormat->Name), cBytes);
wine_tsx11_lock();
XChangeProperty(display, request, rprop, event->target,
8, PropModeReplace, lpClipData, cBytes);
do
{
int nelements = min(cBytes, 65536);
XChangeProperty(display, request, rprop, event->target,
8, mode, lpClipData, nelements);
mode = PropModeAppend;
cBytes -= nelements;
lpClipData += nelements;
} while (cBytes > 0);
wine_tsx11_unlock();
GlobalUnlock(hClipData);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment