/* This function is a helper function for the wtk_frame_handler() function. It is called when a pointer RELEASE event is sent to the resize window. This function completes the resize operation if the RELEASE event was inside the parent window's boundaries. */
static void wtk_handle_resize_release(struct wtk_frame *frame, struct win_pointer_event const *event)
/* This function is a helper function for the wtk_frame_handler() function. It is called when a pointer RELEASE event is sent to the resize window. This function completes the resize operation if the RELEASE event was inside the parent window's boundaries. */
static void wtk_handle_resize_release(struct wtk_frame *frame, struct win_pointer_event const *event)
{
	bool is_inside;
	switch (frame->state) {
	case WTK_FRAME_RESIZING:
		wtk_stop_drag(&(event->last_pos));
		win_grab_pointer(NULL);
		frame->state = WTK_FRAME_NORMAL;
		is_inside = win_is_inside_window(win_get_parent(frame->
				container), &(event->pos));
		if (is_inside) {
			struct win_area contents_area
				= *win_get_area(frame->contents);
			contents_area.size.x += event->pos.x -
					wtk_drag_origin.x;
			contents_area.size.y += event->pos.y -
					wtk_drag_origin.y;
			wtk_resize_frame(frame, &contents_area);
		}
		break;
	default:
		break;
	}
}