/* Compute window position on root window. 
This function calculates the position of a window on the root window. It traverses all parent windows and adds their position to get the position of the given window. */
void win_translate_win_to_root(struct win_window const *start_win, struct win_point *return_pos)
/* Compute window position on root window. 
This function calculates the position of a window on the root window. It traverses all parent windows and adds their position to get the position of the given window. */
void win_translate_win_to_root(struct win_window const *start_win, struct win_point *return_pos)
{
	struct win_window *win;
	Assert(start_win);
	Assert(return_pos);
	return_pos->x = start_win->attributes.area.pos.x;
	return_pos->y = start_win->attributes.area.pos.y;
	win = start_win->parent;
	while (win) {
		return_pos->x += win->attributes.area.pos.x;
		return_pos->y += win->attributes.area.pos.y;
		win = win->parent;
	}
}