window.c
// top-level, visible windows. DOES include non-managable docks/panels
top-level, visible windows. DOES include non-managable docks/panels
top - level visible windows . DOES include non - managable docks / panels
winlist* windows_in_play()
{
	if (cache_inplay->len) return cache_inplay;
	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 == IsViewable)
				winlist_append(cache_inplay, wins[i], NULL);
		}
	}
	if (wins) XFree(wins);
	return cache_inplay;
}
winlist * windows_in_play ( ) { if ( cache_inplay -> len ) return cache_inplay ; 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 == IsViewable ) winlist_append ( cache_inplay , wins [ i ] , NULL ) ; } } if ( wins ) XFree ( wins ) ; return cache_inplay ; }
top-level, visible windows.
top - level visible windows .