Someone
public text v1 · immutable e = XGetWindowProperty(X11->display, event->xproperty.window, ATOM(_NET_WM_STATE), 0, 1024,
False, XA_ATOM, &ret, &format, &nitems, &after, &data);
if (e == Success && ret == XA_ATOM && format == 32 && nitems > 0) {
Atom *states = (Atom *) data;
unsigned long i;
for (i = 0; i < nitems; i++) {
if (states[i] == ATOM(_NET_WM_STATE_MAXIMIZED_VERT)
|| states[i] == ATOM(_NET_WM_STATE_MAXIMIZED_HORZ))
max = true;
else if (states[i] == ATOM(_NET_WM_STATE_FULLSCREEN))
full = true;
}
}