/** Check whether the needed X extensions are present on the * server-side (all the data have been previously pre-fetched in the * extension cache). Then send requests to check their version by * sending QueryVersion requests which is compulsory because the * client MUST negotiate the version of the extension before * executing extension requests */ void display_init_extensions(void) { globalconf.extensions.composite = xcb_get_extension_data(globalconf.connection, &xcb_composite_id); globalconf.extensions.xfixes = xcb_get_extension_data(globalconf.connection, &xcb_xfixes_id); globalconf.extensions.damage = xcb_get_extension_data(globalconf.connection, &xcb_damage_id); globalconf.extensions.randr = xcb_get_extension_data(globalconf.connection, &xcb_randr_id); if(!globalconf.extensions.composite || !globalconf.extensions.composite->present) fatal("No Composite extension"); debug("Composite: major_opcode=%ju", (uintmax_t) globalconf.extensions.composite->major_opcode); if(!globalconf.extensions.xfixes || !globalconf.extensions.xfixes->present) fatal("No XFixes extension"); debug("XFixes: major_opcode=%ju", (uintmax_t) globalconf.extensions.xfixes->major_opcode); if(!globalconf.extensions.damage || !globalconf.extensions.damage->present) fatal("No Damage extension"); debug("Damage: major_opcode=%ju", (uintmax_t) globalconf.extensions.damage->major_opcode); _init_extensions_cookies.composite = xcb_composite_query_version_unchecked(globalconf.connection, XCB_COMPOSITE_MAJOR_VERSION, XCB_COMPOSITE_MINOR_VERSION); _init_extensions_cookies.damage = xcb_damage_query_version_unchecked(globalconf.connection, XCB_DAMAGE_MAJOR_VERSION, XCB_DAMAGE_MINOR_VERSION); _init_extensions_cookies.xfixes = xcb_xfixes_query_version_unchecked(globalconf.connection, XCB_XFIXES_MAJOR_VERSION, XCB_XFIXES_MINOR_VERSION); if(globalconf.extensions.randr && globalconf.extensions.randr->present) _init_extensions_cookies.randr = xcb_randr_query_version(globalconf.connection, XCB_RANDR_MAJOR_VERSION, XCB_RANDR_MINOR_VERSION); else globalconf.extensions.randr = NULL; }
void _ecore_x_composite_init(const xcb_query_extension_reply_t *reply) { #ifdef ECORE_XCB_COMPOSITE if (reply && reply->present) _ecore_xcb_composite_init_cookie = xcb_composite_query_version_unchecked(_ecore_xcb_conn, XCB_COMPOSITE_MAJOR_VERSION, XCB_COMPOSITE_MINOR_VERSION); #endif /* ECORE_XCB_COMPOSITE */ } /* _ecore_x_composite_init */
void _ecore_xcb_composite_finalize(void) { #ifdef ECORE_XCB_COMPOSITE const xcb_query_extension_reply_t *ext_reply; #endif LOGFN(__FILE__, __LINE__, __FUNCTION__); #ifdef ECORE_XCB_COMPOSITE ext_reply = xcb_get_extension_data(_ecore_xcb_conn, &xcb_composite_id); if ((ext_reply) && (ext_reply->present)) { xcb_composite_query_version_cookie_t cookie; xcb_composite_query_version_reply_t *reply; cookie = xcb_composite_query_version_unchecked(_ecore_xcb_conn, XCB_COMPOSITE_MAJOR_VERSION, XCB_COMPOSITE_MINOR_VERSION); reply = xcb_composite_query_version_reply(_ecore_xcb_conn, cookie, NULL); if (reply) { // if ((reply->major_version >= XCB_COMPOSITE_MAJOR_VERSION) && if (reply->minor_version >= XCB_COMPOSITE_MINOR_VERSION) { # ifdef ECORE_XCB_RENDER if (_ecore_xcb_render_avail_get()) { # ifdef ECORE_XCB_XFIXES if (_ecore_xcb_xfixes_avail_get()) _composite_avail = EINA_TRUE; # endif } # endif } free(reply); } } #endif }
void Extensions::init() { xcb_connection_t *c = connection(); xcb_prefetch_extension_data(c, &xcb_shape_id); xcb_prefetch_extension_data(c, &xcb_randr_id); xcb_prefetch_extension_data(c, &xcb_damage_id); xcb_prefetch_extension_data(c, &xcb_composite_id); xcb_prefetch_extension_data(c, &xcb_xfixes_id); xcb_prefetch_extension_data(c, &xcb_render_id); xcb_prefetch_extension_data(c, &xcb_sync_id); m_shape.name = QByteArray("SHAPE"); m_randr.name = QByteArray("RANDR"); m_damage.name = QByteArray("DAMAGE"); m_composite.name = QByteArray("Composite"); m_fixes.name = QByteArray("XFIXES"); m_render.name = QByteArray("RENDER"); m_sync.name = QByteArray("SYNC"); extensionQueryReply(xcb_get_extension_data(c, &xcb_shape_id), &m_shape); extensionQueryReply(xcb_get_extension_data(c, &xcb_randr_id), &m_randr); extensionQueryReply(xcb_get_extension_data(c, &xcb_damage_id), &m_damage); extensionQueryReply(xcb_get_extension_data(c, &xcb_composite_id), &m_composite); extensionQueryReply(xcb_get_extension_data(c, &xcb_xfixes_id), &m_fixes); extensionQueryReply(xcb_get_extension_data(c, &xcb_render_id), &m_render); extensionQueryReply(xcb_get_extension_data(c, &xcb_sync_id), &m_sync); // extension specific queries xcb_shape_query_version_cookie_t shapeVersion; xcb_randr_query_version_cookie_t randrVersion; xcb_damage_query_version_cookie_t damageVersion; xcb_composite_query_version_cookie_t compositeVersion; xcb_xfixes_query_version_cookie_t xfixesVersion; xcb_render_query_version_cookie_t renderVersion; xcb_sync_initialize_cookie_t syncVersion; if (m_shape.present) { shapeVersion = xcb_shape_query_version_unchecked(c); } if (m_randr.present) { randrVersion = xcb_randr_query_version_unchecked(c, RANDR_MAX_MAJOR, RANDR_MAX_MINOR); } if (m_damage.present) { damageVersion = xcb_damage_query_version_unchecked(c, DAMAGE_MAX_MAJOR, DAMAGE_MIN_MAJOR); } if (m_composite.present) { compositeVersion = xcb_composite_query_version_unchecked(c, COMPOSITE_MAX_MAJOR, COMPOSITE_MAX_MINOR); } if (m_fixes.present) { xfixesVersion = xcb_xfixes_query_version_unchecked(c, XFIXES_MAX_MAJOR, XFIXES_MAX_MINOR); } if (m_render.present) { renderVersion = xcb_render_query_version_unchecked(c, RENDER_MAX_MAJOR, RENDER_MAX_MINOR); } if (m_sync.present) { syncVersion = xcb_sync_initialize(c, SYNC_MAX_MAJOR, SYNC_MAX_MINOR); } // handle replies if (m_shape.present) { initVersion<xcb_shape_query_version_reply_t>(shapeVersion, &xcb_shape_query_version_reply, &m_shape); } if (m_randr.present) { initVersion<xcb_randr_query_version_reply_t>(randrVersion, &xcb_randr_query_version_reply, &m_randr); } if (m_damage.present) { initVersion<xcb_damage_query_version_reply_t>(damageVersion, &xcb_damage_query_version_reply, &m_damage); } if (m_composite.present) { initVersion<xcb_composite_query_version_reply_t>(compositeVersion, &xcb_composite_query_version_reply, &m_composite); } if (m_fixes.present) { initVersion<xcb_xfixes_query_version_reply_t>(xfixesVersion, &xcb_xfixes_query_version_reply, &m_fixes); } if (m_render.present) { initVersion<xcb_render_query_version_reply_t>(renderVersion, &xcb_render_query_version_reply, &m_render); } if (m_sync.present) { initVersion<xcb_sync_initialize_reply_t>(syncVersion, &xcb_sync_initialize_reply, &m_sync); } kDebug(1212) << "Extensions: shape: 0x" << QString::number(m_shape.version, 16) << " composite: 0x" << QString::number(m_composite.version, 16) << " render: 0x" << QString::number(m_render.version, 16) << " fixes: 0x" << QString::number(m_fixes.version, 16) << " randr: 0x" << QString::number(m_randr.version, 16) << " sync: 0x" << QString::number(m_sync.version, 16) << " damage: 0x " << QString::number(m_damage.version, 16) << endl; }