+static int do_xinerama_check(void)
+{
+ const xcb_query_extension_reply_t *data =
+ xcb_get_extension_data(conn, &xcb_xinerama_id);
+ if (!data || !data->present)
+ return printf("do_xinerama_check: no ext\n"), 0;
+
+ xcb_xinerama_is_active_cookie_t cookie =
+ xcb_xinerama_is_active(conn);
+ if (!cookie.sequence)
+ return printf("do_xinerama_check: no cookie\n"), 0;
+
+ xcb_xinerama_is_active_reply_t *reply =
+ xcb_xinerama_is_active_reply(conn, cookie, NULL);
+ if (!reply)
+ printf("do_xinerama_check: no reply\n"), 0;
+ else
+ printf("do_xinerama_check: %d\n", reply->state);
+ return reply && reply->state;
+}
+
+static xcb_xinerama_query_screens_reply_t *do_query_screens(void)
+{
+ xcb_xinerama_query_screens_cookie_t cookie =
+ xcb_xinerama_query_screens(conn);
+ xcb_xinerama_query_screens_reply_t *reply =
+ xcb_xinerama_query_screens_reply(conn, cookie, NULL);
+ if (!reply)
+ printf("do_query_screens: no reply\n");
+ else
+ printf("do_query_screens: %d screens\n",
+ xcb_xinerama_query_screens_screen_info_length(reply));
+ return reply;
+}
+