mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-05 12:18:09 +02:00
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:
parent
c5ad92077e
commit
4db1241037
1 changed files with 2 additions and 18 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue