[fdo] Can anyone help me understand xGetImageReply in libx11?

Alan Coopersmith alan.coopersmith at oracle.com
Sat Jul 31 16:42:08 UTC 2021


On 7/30/21 9:36 PM, Chuanlong Du wrote:
> What is the value of rep.length after the call XReply at line 85? Is it (height 
> of screen * width of screen) or (the passed parameter height * the passed 
> parameter width)?

It is the number of 32-bit-words of data beyond the basic 32-byte reply header
that is sent over the X11 protocol, as defined in the protocol spec at:

https://www.x.org/releases/current/doc/xproto/x11protocol.html

The value depends on the number of bits per pixel as well as the height
and width of the image area (not the entire screen) - for the exact
calculations the X server does to determine the value, see the X server
code in DoGetImage:

https://gitlab.freedesktop.org/xorg/xserver/-/blob/master/dix/dispatch.c#L2138

-- 
	-Alan Coopersmith-               alan.coopersmith at oracle.com
	 Oracle Solaris Engineering - https://blogs.oracle.com/alanc


More information about the freedesktop mailing list