14 #include <xcb/xinerama.h>
26 if (output->
rect.
x == x && output->
rect.
y == y)
38 xcb_xinerama_query_screens_reply_t *reply;
39 xcb_xinerama_screen_info_t *screen_info;
41 reply = xcb_xinerama_query_screens_reply(conn, xcb_xinerama_query_screens_unchecked(conn), NULL);
43 ELOG(
"Couldn't get Xinerama screens\n");
46 screen_info = xcb_xinerama_query_screens_screen_info(reply);
47 int screens = xcb_xinerama_query_screens_screen_info_length(reply);
49 for (
int screen = 0; screen < screens; screen++) {
52 DLOG(
"Re-used old Xinerama screen %p\n", s);
60 DLOG(
"Created new Xinerama screen %s (%p)\n", s->
name, s);
62 s->
rect.
x = screen_info[screen].x_org;
63 s->
rect.
y = screen_info[screen].y_org;
64 s->
rect.
width = screen_info[screen].width;
75 DLOG(
"found Xinerama screen: %d x %d at %d x %d\n",
76 screen_info[screen].
width, screen_info[screen].
height,
77 screen_info[screen].x_org, screen_info[screen].y_org);
83 ELOG(
"No screens found. Please fix your setup. i3 will exit now.\n");
94 if (!xcb_get_extension_data(
conn, &xcb_xinerama_id)->present) {
95 DLOG(
"Xinerama extension not found, disabling.\n");
98 xcb_xinerama_is_active_reply_t *reply;
99 reply = xcb_xinerama_is_active_reply(
conn, xcb_xinerama_is_active(
conn), NULL);
101 if (reply == NULL || !reply->state) {
102 DLOG(
"Xinerama is not active (in your X-Server), disabling.\n");
115 ws = get_first_workspace_for_output(output);
116 initialize_output(
conn, output, ws);