I have created a program that creates a window using XCreateWindow. This works perfectly on my system and many others but on many, it is causing a few weird problems. e.g. the ID that I got from it clashes with the id of the terminal from which the program is launched. In one such case, gnome-terminal also has the window ID of 0x2400001 (parent is root) and my program's window ID is also 0x2400001 (its parent is also root). Any suggestions what might be going wrong?
views:
385answers:
3Please detail you question. can You give at list output of xlsclients -al?
The window id's are probably only unique within each connection to the X server (i.e. different processes connecting to the X server may get the same window id and the X server uses the connection AND window id to separate them internally).
I think X makes no promises about the window id, e.g. them being unique across processes or anything so it is better not to try to use them for any other purposes.
I would not be surprised to see X implementations that just return consecutive numbers as window ids starting with the same value (e.g. 1) for each connection, which would explain your experience, e.g. the first window in every client seems to have the same window id on that X implementation.
The Xserver creates a unique opaque id for every window. The method you are using for identifying the window id is probably wrong.
Your question is a symptom to a different problem. What problem are you really trying to solve?