char *xwindow_get_string_property(Window win, Atom a, int *nret) { char *p; int n; n=xwindow_get_property(win, a, XA_STRING, 64L, TRUE, (uchar**)&p); if(nret!=NULL) *nret=n; return (n<=0 ? NULL : p); }
bool xwindow_get_integer_property(Window win, Atom a, int *vret) { long *p=NULL; ulong n; n=xwindow_get_property(win, a, XA_INTEGER, 1L, FALSE, (uchar**)&p); if(n>0 && p!=NULL){ *vret=*p; XFree((void*)p); return TRUE; } return FALSE; }
bool xwindow_get_state_property(Window win, int *state) { CARD32 *p=NULL; if(xwindow_get_property(win, ioncore_g.atom_wm_state, ioncore_g.atom_wm_state, 2L, FALSE, (uchar**)&p)<=0) return FALSE; *state=*p; XFree((void*)p); return TRUE; }
bool netwm_check_initial_fullscreen(WClientWin *cwin) { int i, n; long *data; n=xwindow_get_property(cwin->win, atom_net_wm_state, XA_ATOM, 1, TRUE, (uchar**)&data); if(n<0) return FALSE; for(i=0; i<n; i++){ if(data[i]==(long)atom_net_wm_state_fullscreen) return TRUE; } XFree((void*)data); return FALSE; }
WScreen *netwm_check_initial_fullscreen(WClientWin *cwin) { int i, n; int ret=0; long *data; n=xwindow_get_property(cwin->win, atom_net_wm_state, XA_ATOM, 1, TRUE, (uchar**)&data); if(n<0) return NULL; for(i=0; i<n; i++){ if(data[i]==(long)atom_net_wm_state_fullscreen) return region_screen_of((WRegion*)cwin); } XFree((void*)data); return NULL; }