/* Remove window from parent's linked list. 
This function pulls out a window from the parent window's linked list of of child windows. This function is used when rearranging child windows. */
static void win_unlink(struct win_window *win)
/* Remove window from parent's linked list. 
This function pulls out a window from the parent window's linked list of of child windows. This function is used when rearranging child windows. */
static void win_unlink(struct win_window *win)
{
	if (win->next_sibling == win) {
		win->parent->top_child = NULL;
	} else {
		if (win->parent->top_child == win) {
			win->parent->top_child = win->next_sibling;
		}
		win->next_sibling->prev_sibling = win->prev_sibling;
		win->prev_sibling->next_sibling = win->next_sibling;
	}
	win->parent = NULL;
	win->next_sibling = NULL;
	win->prev_sibling = NULL;
}