From 06d67b6abfd4d5ed8ceecd998b08cd1103946f26 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 10 Apr 2020 17:08:26 +0200 Subject: [PATCH] x11: XMaxRequestSize returns 4-byte units XMaxRequestSize/XMaxExtendedRequestSize are documented to return the maximum size in 4-byte units, whereas we are comparing this to byte lenghts. We can afford 4x the data here. Since I don't know the payload size of the XChangeProperty request, be generous and allot 400 bytes for it, we have some to spare. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1198 --- src/x11/meta-x11-selection-output-stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x11/meta-x11-selection-output-stream.c b/src/x11/meta-x11-selection-output-stream.c index f51dbc4c3..a3ac76629 100644 --- a/src/x11/meta-x11-selection-output-stream.c +++ b/src/x11/meta-x11-selection-output-stream.c @@ -110,7 +110,7 @@ get_max_request_size (MetaX11Display *display) if (size <= 0) size = XMaxRequestSize (display->xdisplay); - return size - 100; + return (size - 100) * 4; } static gboolean