[mutter/wip/carlosg/incr-is-fubar: 29/42] x11: XMaxRequestSize returns 4-byte units



commit 06d67b6abfd4d5ed8ceecd998b08cd1103946f26
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Apr 10 17:08:26 2020 +0200

    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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]