Search code examples
xlib

How to set input mask for window created by another application


I want to write client which receives all event from window which is created and managed by another client. XSelectInput method allows to do it but I have not get Window object. I have only window id and I think that I have to create Window object and assign id to it. But I don't know how to do this. I can not find Window doc in google. I am Java developer and I am used to javadoc.


Solution

  • Window (as almost any other X11 resource id) is just typedef to unsigned 32 bit int. Just cast your id to uint32

    In X.h:

    typedef unsigned long XID;
    typedef CARD32 XID;
    typedef XID Window;