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
-
read the _NET_WM_STATE property and check its content (as described in http://standards.freedesktop.org/wm-spec/wm-spec-1.3.html#id2507241).
读取_NET_WM_STATE属性并检查其内容(如http://standards.freedesktop.org/wm-spec/wm-spec-1.3.html#id2507241所述)。
-
read the WM_STATE property and check its content (as described in http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.3.1).
读取WM_STATE属性并检查其内容(如http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.3.1所述)。
#1
2
-
read the _NET_WM_STATE property and check its content (as described in http://standards.freedesktop.org/wm-spec/wm-spec-1.3.html#id2507241).
读取_NET_WM_STATE属性并检查其内容(如http://standards.freedesktop.org/wm-spec/wm-spec-1.3.html#id2507241所述)。
-
read the WM_STATE property and check its content (as described in http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.3.1).
读取WM_STATE属性并检查其内容(如http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.3.1所述)。