window.c
// top-level windows, visible or not. DOES include non-managable docks/panels
top-level windows, visible or not. DOES include non-managable docks/panels
top - level windows visible or not . DOES include non - managable docks / panels
winlist* window_children()
{
	winlist *l = winlist_new();
	unsigned int nwins; int i; Window w1, w2, *wins;
	if (XQueryTree(display, root, &w1, &w2, &wins, &nwins) && wins)
	{
		for (i = 0; i < nwins; i++)
		{
			XWindowAttributes *attr = window_get_attributes(wins[i]);
			if (attr && attr->override_redirect == False && (attr->map_state == IsUnmapped || attr->map_state == IsViewable))
				winlist_append(l, wins[i], NULL);
		}
	}
	if (wins) XFree(wins);
	return l;
}
winlist * window_children ( ) { winlist * l = winlist_new ( ) ; unsigned int nwins ; int i ; Window w1 , w2 , * wins ; if ( XQueryTree ( display , root , & w1 , & w2 , & wins , & nwins ) && wins ) { for ( i = 0 ; i < nwins ; i ++ ) { XWindowAttributes * attr = window_get_attributes ( wins [ i ] ) ; if ( attr && attr -> override_redirect == False && ( attr -> map_state == IsUnmapped || attr -> map_state == IsViewable ) ) winlist_append ( l , wins [ i ] , NULL ) ; } } if ( wins ) XFree ( wins ) ; return l ; }
top-level windows, visible or not.
top - level windows visible or not .