diff options
author | Andreas Schwab <schwab@suse.de> | 2008-05-26 12:03:03 +0000 |
---|---|---|
committer | Andreas Schwab <schwab@suse.de> | 2008-05-26 12:03:03 +0000 |
commit | 0ca6242b52b3cb808ec48db5fee03e754b4b7234 (patch) | |
tree | 6129df83eb68c4e0212e5cb4be557651799c6250 /src/xselect.c | |
parent | 0c12cecb9aade781b689680d2c5199fcf17008ba (diff) | |
download | emacs-0ca6242b52b3cb808ec48db5fee03e754b4b7234.tar.gz |
(x_reply_selection_request): Properly handle format ==
32. Always send multiples of format size.
Diffstat (limited to 'src/xselect.c')
-rw-r--r-- | src/xselect.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/xselect.c b/src/xselect.c index 0d09f138d45..dd5c1dcc6ba 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -808,7 +808,7 @@ x_reply_selection_request (event, format, data, size, type) { int i = ((bytes_remaining < max_bytes) ? bytes_remaining - : max_bytes); + : max_bytes) / format_bytes; BLOCK_INPUT; @@ -816,15 +816,18 @@ x_reply_selection_request (event, format, data, size, type) = expect_property_change (display, window, reply.property, PropertyDelete); - TRACE1 ("Sending increment of %d bytes", i); + TRACE1 ("Sending increment of %d elements", i); TRACE1 ("Set %s to increment data", XGetAtomName (display, reply.property)); /* Append the next chunk of data to the property. */ XChangeProperty (display, window, reply.property, type, format, - PropModeAppend, data, i / format_bytes); - bytes_remaining -= i; - data += i; + PropModeAppend, data, i); + bytes_remaining -= i * format_bytes; + if (format == 32) + data += i * sizeof (long); + else + data += i * format_bytes; XFlush (display); had_errors = x_had_errors_p (display); UNBLOCK_INPUT; |