/* This function is a helper function for the wtk_frame_handler() function. It is called when a pointer RELEASE event is sent to the container window. This function completes the move operation if the RELEASE event was inside the parent window's boundaries. */
static void wtk_handle_frame_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 container window. This function completes the move operation if the RELEASE event was inside the parent window's boundaries. */
static void wtk_handle_frame_release(struct wtk_frame *frame, struct win_pointer_event const *event)
{
	bool is_inside;
	switch (frame->state) {
	case WTK_FRAME_MOVING:
		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 area = *win_get_area(frame->container);
			area.pos.x += event->pos.x - wtk_drag_origin.x;
			area.pos.y += event->pos.y - wtk_drag_origin.y;
			win_set_area(frame->container, &area,
					WIN_ATTR_POSITION);
		}
		break;
	default:
		break;
	}
}