This also adds a change of behaviour (resetting nread) in the case
of multi-chunk selection receipt, but I haven't found a way to test
the latter.
git-svn-id: svn://svn.tartarus.org/sgt/utils@8977
cda61777-01e9-0310-a592-
d414129be87e
/* selection data */
char *seltext;
int sellen, selsize;
-#define SELDELTA 16384
+#define SELDELTA 64
/* functional parameters */
int reading; /* read instead of writing? */
XFree(data);
if (nitems == 0)
break;
+ if (bytes_after == 0) {
+ /*
+ * We've come to the end of the property we're reading.
+ * If we have the Delete flag set, we may be receiving
+ * the selection data in multiple chunks, in which case
+ * we should reset nread to zero so that when the next
+ * chunk arrives we resume reading from the start of the
+ * replaced property. Otherwise, this is our cue to
+ * exit.
+ */
+ if (Delete)
+ nread = 0;
+ else
+ break;
+ }
}
}