aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2022-03-07 13:09:07 +0800
committerPo Lu2022-03-07 13:09:41 +0800
commit03b07fd62e831df2425676005bd962fef81ffc1d (patch)
treebccd7ce1aa3b63b1bd49a301e771904a471b76a3 /src
parent532472220268fb9852b65d60503a446c9e5e57ab (diff)
downloademacs-03b07fd62e831df2425676005bd962fef81ffc1d.tar.gz
emacs-03b07fd62e831df2425676005bd962fef81ffc1d.zip
Fix maximum selection size reporting
* src/xselect.c (selection_quantum): Take into account extended request size.
Diffstat (limited to 'src')
-rw-r--r--src/xselect.c6
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,
98static int 98static int
99selection_quantum (Display *display) 99selection_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);