summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2013-09-24 13:30:32 +0100
committerJon TURNEY <jon.turney@dronecode.org.uk>2014-01-04 16:16:08 +0000
commitdbf983f765f37197d8929ed724574f502ecbb991 (patch)
tree03e02f108172aaf6f0eb1da92ed992b0cc222b78
parent696bd6a62d8e9f982305da4ab2c14b6aa9119f8d (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.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/hw/xwin/winclipboard/xevents.c b/hw/xwin/winclipboard/xevents.c
index e5e1a2ce2..0c7a404ce 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>
@@ -556,29 +557,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,