Search code examples
clinuxunixx11xlib

How do I generate an X11 geometry string using Xlib?


I know you can parse them using XParseGeometry, but I also need to generate them. Are there any built in or external functions that could do this for me?

I tried to make my own function that does this, but it was ridiculously buggy.


Solution

  • Should be something like:

    char buf[42];
    sprintf(buf, "%dx%d+%d+%d", width, height, x, y);