[Xcb] Setting the WM_TRANSIENT_FOR property on a window

Peter Harris git at peter.is-a-geek.org
Mon Mar 22 06:05:18 PDT 2010

On Mon, Mar 22, 2010 at 8:19 AM, Arnaud Fontaine wrote:
> I have attached to this email  a patch (0001) adding missing setters for
> WM_CLASS and WM_TRANSIENT_FOR properties. Like existing setters, all the
> parameters are given  explicitely rather than using a  structure such as
> Xlib does. IMO  this is much more flexible because  it avoids the caller
> to  declare a  structure, fill  it  and pass  them to  the callee  (most
> programs usually have their own data structures).

I see you've used variable length arrays. A few points spring to mind:

 - Variable-length arrays are C99. The Microsoft C compilers still
don't support most of C99.

 - Variable-length arrays are merely a portable way to spell "alloca".
The server folks have just recently (2007) removed all allocas from
the server. There is no portable way to determine the amount of stack
space available, and alloca rarely returns NULL (and variable-length
arrays can't). This matters less in a client side library, since you
can only DoS yourself.

 - Making an extra copy is no fun. XCB uses iovecs to try to avoid
extra copies. You'd have to open-code ChangeProperty to use an iovec,
though, which is ugly. Thoughts?

> If nobody complains about these  patches, I will commit them to xcb/util
> repository.

My comments above are just things I thought of, and not deep
complaints. Feel free to commit if nobody else objects.

Peter Harris

More information about the Xcb mailing list