Commit 4db12410 authored by Jon Turney's avatar Jon Turney

hw/xwin: In SelectionNotify, don't pointlessly retrieve just the size of the property

Don't pointlessly retrieve just the size of the property, if we are then going
to assume we can retrieve the whole property in one request anyhow...
Signed-off-by: Jon Turney's avatarJon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: default avatarColin Harrison <colin.harrison@virgin.net>
parent c5ad9207
......@@ -43,6 +43,7 @@
#undef _XSERVER64
#endif
#include <limits.h>
#include "internal.h"
#include <X11/Xutil.h>
#include <X11/Xatom.h>
......@@ -551,29 +552,12 @@ winClipboardFlushXEvents(HWND hwnd,
}
}
/* Retrieve the size of the stored data */
iReturn = XGetWindowProperty(pDisplay, iWindow, atomLocalProperty, 0, 0, /* Don't get data, just size */
False,
AnyPropertyType,
&xtpText.encoding,
&xtpText.format,
&xtpText.nitems,
&ulReturnBytesLeft, &xtpText.value);
if (iReturn != Success) {
ErrorF("winClipboardFlushXEvents - SelectionNotify - "
"XGetWindowProperty () failed, aborting: %d\n", iReturn);
break;
}
winDebug("SelectionNotify - returned data %d left %d\n",
xtpText.nitems, ulReturnBytesLeft);
/* Retrieve the selection data and delete the property */
iReturn = XGetWindowProperty(pDisplay,
iWindow,
atomLocalProperty,
0,
ulReturnBytesLeft,
INT_MAX,
True,
AnyPropertyType,
&xtpText.encoding,
......
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