/* Draw window, all its siblings and parents within dirty area. 
For windows that are partly transparent, e.g. drop shadows or round corners, the parent is asked to redraw all its child windows, in order to provide a fresh background for the window to draw upon. This applies to windows with the behavior flag REDRAW_PARENT set. */
static void win_draw(struct win_window *win, const struct win_area *dirty_area)
/* Draw window, all its siblings and parents within dirty area. 
For windows that are partly transparent, e.g. drop shadows or round corners, the parent is asked to redraw all its child windows, in order to provide a fresh background for the window to draw upon. This applies to windows with the behavior flag REDRAW_PARENT set. */
static void win_draw(struct win_window *win, const struct win_area *dirty_area)
{
	struct win_clip_region clip;
	if (!win_compute_clipping(win, dirty_area, &clip)) {
		return;
	}
	if (win->parent && (win->attributes.behavior
			& WIN_BEHAVIOR_REDRAW_PARENT)) {
		win_draw_parent(win, dirty_area);
		return;
	}
	win_draw_contents(win, &clip);
	while (win != &win_root) {
		clip.origin.x -= win->attributes.area.pos.x;
		clip.origin.y -= win->attributes.area.pos.y;
		while (win != win->parent->top_child) {
			win = win->prev_sibling;
			if (win->is_mapped) {
				win_draw_child(win, &clip);
			}
		}
		win = win->parent;
	}
}