[Xcb] [ANNOUNCE] xwininfo 1.1.0

Alan Coopersmith alan.coopersmith at oracle.com
Mon Sep 27 10:39:39 PDT 2010

Vincent Torri wrote:
> 1) Why a file for strnlen that is used only once in xwininfo.c ?

Because that's the way Jeremy submitted it, and the way AC_FUNC_STRNLEN
in autoconf expects the code to be delivered, since it uses autoconf's
AC_LIBOBJ to provide a replacement function in a *.c file named for the
function when the system libraries don't have it.

> 2) You query at the beginning some netwm atoms. Just after, line 548,
> you can exit because the window with a name is not found. You should
> here get the replies of the requested atoms. If I'm not mistaken, you
> have to get the replies to free the memory in the server.

Atoms stay around for the life of the server, regardless.   For replies
though, once the server sends them to the client, the space is available
on the buffer for future replies, and is freed when the client exists.

> 3) You can speed up things even more. As you know that shape extension
> has to be initialized, you can query it at the very beginning. The
> initialization can then be done like that:
> a) create the connection
> b) First round trip:
>  * you request the atoms
>  * you prefetch the shape extension data if needed
>  * you do some thing that takes time here (get the screen number,
>    verify the window, etc...)
>  * you get the atoms
>  * you ask for the shape extension data if needed
> c) Second round trip:
>  * you request the QueryVersion for the shape data (if needed),
>    GetGeometry, and other requests if any
>  * you do some things that take time here and can be done in the first
>    round trip (if any)
>  * you get the reply of the QueryVersion (if needed) and GetGeometry
>    requests etc..
> It's a micro optimisation of course, but why not being optimal ?

Thanks for the suggestion - I'll try to look into that when I get a chance
(unless someone else beats me to it by submitting a patch - I'm mostly
 trawling the queue of X.Org modules to release for X11R7.6 katamari right

	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System

More information about the Xcb mailing list