1 #include "ecore_xcb_private.h"
4 * @defgroup Ecore_X_Composite_Group X Composite Extension Functions
6 * Functions related to the X Composite extension.
9 #ifdef ECORE_XCB_COMPOSITE
10 static uint8_t _composite_available = 0;
11 static xcb_composite_query_version_cookie_t _ecore_xcb_composite_init_cookie;
12 #endif /* ECORE_XCB_COMPOSITE */
14 /* To avoid round trips, the initialization is separated in 2
15 functions: _ecore_xcb_composite_init and
16 _ecore_xcb_composite_init_finalize. The first one gets the cookies and
17 the second one gets the replies. */
20 _ecore_x_composite_init(const xcb_query_extension_reply_t *reply)
22 #ifdef ECORE_XCB_COMPOSITE
23 if (reply && reply->present)
24 _ecore_xcb_composite_init_cookie = xcb_composite_query_version_unchecked(_ecore_xcb_conn, XCB_COMPOSITE_MAJOR_VERSION, XCB_COMPOSITE_MINOR_VERSION);
26 #endif /* ECORE_XCB_COMPOSITE */
27 } /* _ecore_x_composite_init */
30 _ecore_x_composite_init_finalize(void)
32 #ifdef ECORE_XCB_COMPOSITE
33 xcb_composite_query_version_reply_t *reply;
35 reply = xcb_composite_query_version_reply(_ecore_xcb_conn,
36 _ecore_xcb_composite_init_cookie,
40 if ((reply->major_version == XCB_COMPOSITE_MAJOR_VERSION) &&
41 (reply->minor_version >= XCB_COMPOSITE_MINOR_VERSION))
42 _composite_available = 1;
47 #endif /* ECORE_XCB_COMPOSITE */
48 } /* _ecore_x_composite_init_finalize */
51 * Return whether the Composite Extension is available.
52 * @return 1 if the Composite Extension is available, 0 if not.
54 * Return 1 if the X server supports the Composite Extension version 0.4
55 * or greater, 0 otherwise.
56 * @ingroup Ecore_X_Composite_Group
59 ecore_x_composite_query(void)
61 #ifdef ECORE_XCB_COMPOSITE
62 return _composite_available;
63 #else /* ifdef ECORE_XCB_COMPOSITE */
65 #endif /* ECORE_XCB_COMPOSITE */
66 } /* ecore_x_composite_query */