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 <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
This commit is contained in:
Jon TURNEY 2013-09-24 13:30:32 +01:00
parent c5ad92077e
commit 4db1241037

View File

@ -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,