diff options
| author | Andreas Schwab | 2008-05-26 12:03:03 +0000 |
|---|---|---|
| committer | Andreas Schwab | 2008-05-26 12:03:03 +0000 |
| commit | 5a9c35e5009f2cee18f4baa57736f604d215f7a9 (patch) | |
| tree | b5fc2a7fd829056b64f84dfaab64e294e07a2cee /src/xselect.c | |
| parent | f8eb1603d22a837bb2554c7b50a1f2311bd1be3e (diff) | |
| download | emacs-5a9c35e5009f2cee18f4baa57736f604d215f7a9.tar.gz emacs-5a9c35e5009f2cee18f4baa57736f604d215f7a9.zip | |
(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) | |||
| 808 | { | 808 | { |
| 809 | int i = ((bytes_remaining < max_bytes) | 809 | int i = ((bytes_remaining < max_bytes) |
| 810 | ? bytes_remaining | 810 | ? bytes_remaining |
| 811 | : max_bytes); | 811 | : max_bytes) / format_bytes; |
| 812 | 812 | ||
| 813 | BLOCK_INPUT; | 813 | BLOCK_INPUT; |
| 814 | 814 | ||
| @@ -816,15 +816,18 @@ x_reply_selection_request (event, format, data, size, type) | |||
| 816 | = expect_property_change (display, window, reply.property, | 816 | = expect_property_change (display, window, reply.property, |
| 817 | PropertyDelete); | 817 | PropertyDelete); |
| 818 | 818 | ||
| 819 | TRACE1 ("Sending increment of %d bytes", i); | 819 | TRACE1 ("Sending increment of %d elements", i); |
| 820 | TRACE1 ("Set %s to increment data", | 820 | TRACE1 ("Set %s to increment data", |
| 821 | XGetAtomName (display, reply.property)); | 821 | XGetAtomName (display, reply.property)); |
| 822 | 822 | ||
| 823 | /* Append the next chunk of data to the property. */ | 823 | /* Append the next chunk of data to the property. */ |
| 824 | XChangeProperty (display, window, reply.property, type, format, | 824 | XChangeProperty (display, window, reply.property, type, format, |
| 825 | PropModeAppend, data, i / format_bytes); | 825 | PropModeAppend, data, i); |
| 826 | bytes_remaining -= i; | 826 | bytes_remaining -= i * format_bytes; |
| 827 | data += i; | 827 | if (format == 32) |
| 828 | data += i * sizeof (long); | ||
| 829 | else | ||
| 830 | data += i * format_bytes; | ||
| 828 | XFlush (display); | 831 | XFlush (display); |
| 829 | had_errors = x_had_errors_p (display); | 832 | had_errors = x_had_errors_p (display); |
| 830 | UNBLOCK_INPUT; | 833 | UNBLOCK_INPUT; |