如何检查窗口是否最小化?

时间:2021-02-21 07:16:03

How can I check if a window is minimized or not using the C interface of xlib?

如何使用xlib的C接口检查窗口是否最小化?

Edit: Should this code work?

编辑:这个代码可以工作吗?

int window_is_minimized(Display *display, Window window) {
    Atom actual_type;
    int actual_format;
    unsigned long i, num_items, bytes_after;
    Atom *atoms;

    atoms=NULL;

    XGetWindowProperty(display, window, vdl_x11_usefull_atoms->_NET_WM_STATE, 0, 1024, False, XA_ATOM, &actual_type, &actual_format, &num_items, &bytes_after, (unsigned char**)&atoms);

    for(i=0; i<num_items; ++i) {
        if(atoms[i]==vdl_x11_usefull_atoms->_NET_WM_STATE_HIDDEN) {
            XFree(atoms);
            return 1;
        }
    }
    XFree(atoms);
    return 0;
}

1 个解决方案

#1


2  

#1


2