how to find the names of all the windows? - Xwindows

This is a discussion on how to find the names of all the windows? - Xwindows ; I want to find the names of all the windows on my screen. So I'm using _NET_CLIENT_LIST to get an array of clients, but i'm not sure what type the clients are. I know actual_type should be able to tell ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: how to find the names of all the windows?

  1. how to find the names of all the windows?

    I want to find the names of all the windows on my screen.
    So I'm using _NET_CLIENT_LIST to get an array of clients, but i'm not
    sure what type the clients are.
    I know actual_type should be able to tell me but i don't know how to
    use it.
    Here's the code (i got from an earlier post):

    Display* display = XOpenDisplay(0);
    if (display)
    {
    Atom atom = XInternAtom(display, "_NET_CLIENT_LIST", True);
    XFlush(display);
    Atom actual_type;
    int actual_format;
    int max_len = 10000;
    unsigned long nitems;
    unsigned long bytes_after;
    unsigned char *prop;


    int status = XGetWindowProperty(display, DefaultRootWindow(display),
    atom, 0, (max_len+3)/4,
    False, AnyPropertyType, &actual_type, &actual_format,
    &nitems, &bytes_after, &prop);
    for (int i = 0; i < nitems; i++)
    {

    cout << (long)prop[i] << "\n";

    }


    thanks!


  2. Re: how to find the names of all the windows?

    chess314@gmail.com wrote:
    > I want to find the names of all the windows on my screen.
    > So I'm using _NET_CLIENT_LIST to get an array of clients, but i'm not
    > sure what type the clients are.


    Look at the code of xlsclients.

    BTW, not all window managers set _NET_CLIENT_LIST.

    --- Casantos


  3. Re: how to find the names of all the windows?


    nojunk@gate.cpmet.ufpel.tche.br wrote:
    > chess314@gmail.com wrote:
    > > I want to find the names of all the windows on my screen.
    > > So I'm using _NET_CLIENT_LIST to get an array of clients, but i'm not
    > > sure what type the clients are.

    >
    > Look at the code of xlsclients.
    >
    > BTW, not all window managers set _NET_CLIENT_LIST.
    >
    > --- Casantos


    xlsclients doesn't do what i want. when i run it it get a list of
    windows that are children of the root window, for some reason these do
    not appear to correspond to the windows that actually appear on my
    screen.
    however when i run my code above i do get a number for each window on
    my screen. I just need help interpreting the number.

    thanks! = )


+ Reply to Thread