/* Add window as first child in parent's linked list. 
This function adds a child window as the top window of a parent. */
static void win_add_top_child(struct win_window *parent, struct win_window *child)
/* Add window as first child in parent's linked list. 
This function adds a child window as the top window of a parent. */
static void win_add_top_child(struct win_window *parent, struct win_window *child)
{
	if (parent->top_child == NULL) {
		child->next_sibling = child;
		child->prev_sibling = child;
	} else {
		child->next_sibling = parent->top_child;
		child->prev_sibling = parent->top_child->prev_sibling;
		child->next_sibling->prev_sibling = child;
		child->prev_sibling->next_sibling = child;
	}
	parent->top_child = child;
	child->parent = parent;
}