/** * Gets the reply of the ShapeGetRectangles request sent by ecore_x_window_shape_rectangles_get_prefetch(). * @ingroup Ecore_X_Shape_Group */ EAPI void ecore_x_window_shape_rectangles_get_fetch(void) { #ifdef ECORE_XCB_SHAPE xcb_shape_get_rectangles_cookie_t cookie; xcb_shape_get_rectangles_reply_t *reply; cookie.sequence = _ecore_xcb_cookie_get(); reply = xcb_shape_get_rectangles_reply(_ecore_xcb_conn, cookie, NULL); _ecore_xcb_reply_cache(reply); #endif /* ECORE_XCB_SHAPE */ } /* ecore_x_window_shape_rectangles_get_fetch */
static bool windowInteractsWithPosition(xcb_connection_t *connection, const QPoint & pos, xcb_window_t w, xcb_shape_sk_t shapeType) { bool interacts = false; xcb_shape_get_rectangles_reply_t *reply = xcb_shape_get_rectangles_reply(connection, xcb_shape_get_rectangles(connection, w, shapeType), NULL); if (reply) { xcb_rectangle_t *rectangles = xcb_shape_get_rectangles_rectangles(reply); if (rectangles) { const int nRectangles = xcb_shape_get_rectangles_rectangles_length(reply); for (int i = 0; !interacts && i < nRectangles; ++i) { interacts = QRect(rectangles[i].x, rectangles[i].y, rectangles[i].width, rectangles[i].height).contains(pos); } } free(reply); } return interacts; }