diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2013-09-24 13:30:32 +0100 |
---|---|---|
committer | Jon TURNEY <jon.turney@dronecode.org.uk> | 2013-09-24 16:45:53 +0100 |
commit | 88a7a041e39624b24ca2d2deaa38d976fd9718b7 (patch) | |
tree | 1241ea8e48cfcaf2998b21f6c38d8ca9685a47e2 | |
parent | eee00b4fc498855eec01579baf35c0a18e907b5f (diff) |
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...
-rw-r--r-- | hw/xwin/winclipboard/xevents.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/hw/xwin/winclipboard/xevents.c b/hw/xwin/winclipboard/xevents.c index 7bae4cdc7..7e98308ce 100644 --- a/hw/xwin/winclipboard/xevents.c +++ b/hw/xwin/winclipboard/xevents.c @@ -44,6 +44,7 @@ #endif #include "internal.h" +#include <limits.h> #include <X11/Xutil.h> #include <X11/Xatom.h> #include <X11/extensions/Xfixes.h> @@ -555,29 +556,12 @@ winClipboardFlushXEvents(HWND hwnd, break; } - /* 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, |