diff options
| author | Po Lu | 2022-03-07 13:09:07 +0800 |
|---|---|---|
| committer | Po Lu | 2022-03-07 13:09:41 +0800 |
| commit | 03b07fd62e831df2425676005bd962fef81ffc1d (patch) | |
| tree | bccd7ce1aa3b63b1bd49a301e771904a471b76a3 | |
| parent | 532472220268fb9852b65d60503a446c9e5e57ab (diff) | |
| download | emacs-03b07fd62e831df2425676005bd962fef81ffc1d.tar.gz emacs-03b07fd62e831df2425676005bd962fef81ffc1d.zip | |
Fix maximum selection size reporting
* src/xselect.c (selection_quantum): Take into account extended
request size.
| -rw-r--r-- | src/xselect.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/xselect.c b/src/xselect.c index 979f4549488..a88c15aa95b 100644 --- a/src/xselect.c +++ b/src/xselect.c | |||
| @@ -98,7 +98,11 @@ static void lisp_data_to_selection_data (struct x_display_info *, Lisp_Object, | |||
| 98 | static int | 98 | static int |
| 99 | selection_quantum (Display *display) | 99 | selection_quantum (Display *display) |
| 100 | { | 100 | { |
| 101 | long mrs = XMaxRequestSize (display); | 101 | long mrs = XExtendedMaxRequestSize (display); |
| 102 | |||
| 103 | if (!mrs) | ||
| 104 | mrs = XMaxRequestSize (display); | ||
| 105 | |||
| 102 | return (mrs < MAX_SELECTION_QUANTUM / X_LONG_SIZE + 25 | 106 | return (mrs < MAX_SELECTION_QUANTUM / X_LONG_SIZE + 25 |
| 103 | ? (mrs - 25) * X_LONG_SIZE | 107 | ? (mrs - 25) * X_LONG_SIZE |
| 104 | : MAX_SELECTION_QUANTUM); | 108 | : MAX_SELECTION_QUANTUM); |