rule.c
// apply a rule list to all windows in current_tag
apply a rule list to all windows in current_tag
apply a rule list to all windows in current_tag
void rulelist_apply(winrule *list)
{
	int i, done = 0; Window w; client *c;
	winrule *bak = config_rules; config_rules = list;
	tag_descend(i, w, c, current_tag)
		if (!done)
	{
		reset_cache_xattr();
		reset_cache_client();
		c = client_create(w);
		if (c) client_rules_apply(c, RULESDEF);
		if (c && c->is_ruled && c->rule && c->rule->flags & RULE_ONCE) done = 1;
		XSync(display, False);
	}
	clients_descend(windows_shaded, i, w, c)
		if (!done && c->manage && c->cache->tags & current_tag)
	{
		reset_cache_xattr();
		reset_cache_client();
		c = client_create(w);
		if (c) client_rules_apply(c, RULESDEF);
		if (c && c->is_ruled && c->rule && c->rule->flags & RULE_ONCE) done = 1;
		XSync(display, False);
	}
	clients_descend(windows_minimized, i, w, c)
		if (!done && c->manage && c->cache->tags & current_tag)
	{
		reset_cache_xattr();
		reset_cache_client();
		c = client_create(w);
		if (c) client_rules_apply(c, RULESDEF);
		if (c && c->is_ruled && c->rule && c->rule->flags & RULE_ONCE) done = 1;
		XSync(display, False);
	}
	config_rules = bak;
}
void rulelist_apply ( winrule * list ) { int i , done = 0 ; Window w ; client * c ; winrule * bak = config_rules ; config_rules = list ; tag_descend ( i , w , c , current_tag ) if ( ! done ) { reset_cache_xattr ( ) ; reset_cache_client ( ) ; c = client_create ( w ) ; if ( c ) client_rules_apply ( c , RULESDEF ) ; if ( c && c -> is_ruled && c -> rule && c -> rule -> flags & RULE_ONCE ) done = 1 ; XSync ( display , False ) ; } clients_descend ( windows_shaded , i , w , c ) if ( ! done && c -> manage && c -> cache -> tags & current_tag ) { reset_cache_xattr ( ) ; reset_cache_client ( ) ; c = client_create ( w ) ; if ( c ) client_rules_apply ( c , RULESDEF ) ; if ( c && c -> is_ruled && c -> rule && c -> rule -> flags & RULE_ONCE ) done = 1 ; XSync ( display , False ) ; } clients_descend ( windows_minimized , i , w , c ) if ( ! done && c -> manage && c -> cache -> tags & current_tag ) { reset_cache_xattr ( ) ; reset_cache_client ( ) ; c = client_create ( w ) ; if ( c ) client_rules_apply ( c , RULESDEF ) ; if ( c && c -> is_ruled && c -> rule && c -> rule -> flags & RULE_ONCE ) done = 1 ; XSync ( display , False ) ; } config_rules = bak ; }
apply a rule list to all windows in current_tag
apply a rule list to all windows in current_tag