[Vala] X11 and pointers help



Hi,

I am trying to get a list of the open windows using
_NET_CLIENT_LIST_STACKING (it is important I use this as I need it in
the order of stacking) as seen here
http://standards.freedesktop.org/wm-spec/wm-spec-1.3.html#id2449346

To do this I am using the Xlib bindings for vala with the following
code, however I cannot get the code at the end of this message to compile

Any help? If I am honest, I am not really sure what the void* stuff is
about :/

--
Andrew



/* Compile with valac --pkg x11 window.vala*/

int main(string[] args) {
    X.init_threads();
    var xdisplay = new X.Display();

    X.Atom type;
    int format;
    ulong nitems;
    ulong bytes_after;
    void* list;

    xdisplay.get_window_property(xdisplay.default_root_window(),
xdisplay.intern_atom("_NET_CLIENT_LIST_STACKING", true),
        0, long.MAX, false, X.XA_CARDINAL, out type, out format, out
nitems, out bytes_after, out list);

    for (int i = 0; i < nitems; i++) {
        ulong xid = (ulong) list[i];
        stdout.printf(xid.to_string());
    }

    X.free(list);
    return 0;
}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]