tag.c
// raise all windows in a tag
raise all windows in a tag
raise all windows in a tag
void tag_raise(unsigned int tag)
{
	int i, found = 0, shaded = 0; Window w; client *c;
	winlist *stack;
	clients_ascend(windows_shaded, i, w, c)
		if (c->manage && c->cache->tags & tag)
			{ client_reveal(c); shaded++; }
	if (shaded)
	{
		XSync(display, False);
		reset_cache_xattr();
		reset_cache_client();
		reset_cache_inplay();
	}
	stack = winlist_new();
	managed_descend(i, w, c)
		if (winlist_find(stack, w) < 0 && c->visible && c->trans == None
			&& client_has_state(c, netatoms[_NET_WM_STATE_ABOVE])
			&& client_has_state(c, netatoms[_NET_WM_STATE_STICKY]))
				client_stack_family(c, stack);
	tag_descend(i, w, c, tag)
		if (winlist_find(stack, w) < 0 && c->visible && c->trans == None
			&& client_has_state(c, netatoms[_NET_WM_STATE_ABOVE]))
				{ client_stack_family(c, stack); found++; }
	clients_descend(windows_in_play(), i, w, c)
		if (winlist_find(stack, w) < 0 && c->visible && c->trans == None
			&& c->type == netatoms[_NET_WM_WINDOW_TYPE_DOCK])
				client_stack_family(c, stack);
	tag_descend(i, w, c, tag)
		if (winlist_find(stack, w) < 0 && c->trans == None)
			{ client_stack_family(c, stack); found++; }
	if (stack->len) XRaiseWindow(display, stack->array[0]);
	if (stack->len > 1) XRestackWindows(display, stack->array, stack->len);
	winlist_free(stack);
	tag_set_current(tag);
	if (config_only_auto) tag_only(tag);
	clients_descend(windows_activated, i, w, c) if (c->cache->tags & tag)
		{ client_activate(c, RAISE, WARPDEF); break; }
	if (found) notice("Tag %d", tag_to_desktop(tag)+1);
	else notice("Tag %d (empty!)", tag_to_desktop(tag)+1);
}
void tag_raise ( unsigned int tag ) { int i , found = 0 , shaded = 0 ; Window w ; client * c ; winlist * stack ; clients_ascend ( windows_shaded , i , w , c ) if ( c -> manage && c -> cache -> tags & tag ) { client_reveal ( c ) ; shaded ++ ; } if ( shaded ) { XSync ( display , False ) ; reset_cache_xattr ( ) ; reset_cache_client ( ) ; reset_cache_inplay ( ) ; } stack = winlist_new ( ) ; managed_descend ( i , w , c ) if ( winlist_find ( stack , w ) < 0 && c -> visible && c -> trans == None && client_has_state ( c , netatoms [ _NET_WM_STATE_ABOVE ] ) && client_has_state ( c , netatoms [ _NET_WM_STATE_STICKY ] ) ) client_stack_family ( c , stack ) ; tag_descend ( i , w , c , tag ) if ( winlist_find ( stack , w ) < 0 && c -> visible && c -> trans == None && client_has_state ( c , netatoms [ _NET_WM_STATE_ABOVE ] ) ) { client_stack_family ( c , stack ) ; found ++ ; } clients_descend ( windows_in_play ( ) , i , w , c ) if ( winlist_find ( stack , w ) < 0 && c -> visible && c -> trans == None && c -> type == netatoms [ _NET_WM_WINDOW_TYPE_DOCK ] ) client_stack_family ( c , stack ) ; tag_descend ( i , w , c , tag ) if ( winlist_find ( stack , w ) < 0 && c -> trans == None ) { client_stack_family ( c , stack ) ; found ++ ; } if ( stack -> len ) XRaiseWindow ( display , stack -> array [ 0 ] ) ; if ( stack -> len > 1 ) XRestackWindows ( display , stack -> array , stack -> len ) ; winlist_free ( stack ) ; tag_set_current ( tag ) ; if ( config_only_auto ) tag_only ( tag ) ; clients_descend ( windows_activated , i , w , c ) if ( c -> cache -> tags & tag ) { client_activate ( c , RAISE , WARPDEF ) ; break ; } if ( found ) notice ( " " , tag_to_desktop ( tag ) + 1 ) ; else notice ( " " , tag_to_desktop ( tag ) + 1 ) ; }
raise all windows in a tag
raise all windows in a tag
// if this tag was previously hidden, reveal it // locate windows with _NET_WM_STATE_ABOVE and _NET_WM_STATE_STICKY // locate windows with _NET_WM_STATE_ABOVE in this tag // locate _NET_WM_WINDOW_TYPE_DOCK windows // locate all other windows in the tag // raise the top window in the stack // stack everything else, in order, underneath top window // focus the last-focused client in the tag // in case no windows are in the tag, show some activity