From 4db1241037e3fe8f0a46888377b8fef40bae9065 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Tue, 24 Sep 2013 13:30:32 +0100 Subject: [PATCH] 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 Reviewed-by: Colin Harrison --- hw/xwin/winclipboard/xevents.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/hw/xwin/winclipboard/xevents.c b/hw/xwin/winclipboard/xevents.c index f4212b49d..42e9147b5 100644 --- a/hw/xwin/winclipboard/xevents.c +++ b/hw/xwin/winclipboard/xevents.c @@ -43,6 +43,7 @@ #undef _XSERVER64 #endif +#include #include "internal.h" #include #include @@ -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,