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.
This commit is contained in:
parent
84f6bb3e3f
commit
b952751158
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue