xcb_drawable_t drawable;
uint32_t width, height, depth;
+
+ xcb_special_event_t *special_event;
};
static bool
{
xcb_get_geometry_cookie_t geom_cookie;
xcb_get_geometry_reply_t *geom_reply;
+ xcb_void_cookie_t cookie;
+ xcb_generic_error_t *error;
+ xcb_present_event_t peid;
assert(drawable);
scrn->depth = geom_reply->depth;
free(geom_reply);
+ if (scrn->special_event) {
+ xcb_unregister_for_special_event(scrn->conn, scrn->special_event);
+ scrn->special_event = NULL;
+ }
+
+ peid = xcb_generate_id(scrn->conn);
+ cookie =
+ xcb_present_select_input_checked(scrn->conn, peid, scrn->drawable,
+ XCB_PRESENT_EVENT_MASK_CONFIGURE_NOTIFY |
+ XCB_PRESENT_EVENT_MASK_COMPLETE_NOTIFY |
+ XCB_PRESENT_EVENT_MASK_IDLE_NOTIFY);
+
+ error = xcb_request_check(scrn->conn, cookie);
+ if (error) {
+ free(error);
+ return false;
+ } else
+ scrn->special_event =
+ xcb_register_for_special_xge(scrn->conn, &xcb_present_id, peid, 0);
+
return true;
}
assert(vscreen);
+ if (scrn->special_event)
+ xcb_unregister_for_special_event(scrn->conn, scrn->special_event);
scrn->base.pscreen->destroy(scrn->base.pscreen);
pipe_loader_release(&scrn->base.dev, 1);
FREE(scrn);