7 screen_register(xcb_connection_t *conn, d_screen_t *sc)
12 xcb_intern_atom_cookie_t ack;
13 xcb_intern_atom_reply_t *arep;
14 xcb_get_selection_owner_cookie_t sck;
15 xcb_get_selection_owner_reply_t *srep;
18 w = xcb_generate_id(conn);
19 xcb_create_window(conn, XCB_COPY_FROM_PARENT, w, sc->super.root,
20 0, 0, 1, 1, 0, XCB_WINDOW_CLASS_INPUT_ONLY,
21 sc->super.root_visual, 0, NULL);
23 name = g_strdup_printf("_NET_WM_CM_S%d", sc->num);
24 ack = xcb_intern_atom(conn, FALSE, strlen(name), name);
25 arep = xcb_intern_atom_reply(conn, ack, NULL);
28 sck = xcb_get_selection_owner(conn, arep->atom);
29 srep = xcb_get_selection_owner_reply(conn, sck, NULL);
30 taken = !!srep->owner;
33 printf(_("screen %d already has a composite manager, skipping\n"),
38 xcb_set_selection_owner(conn, w, arep->atom, XCB_CURRENT_TIME);
39 sck = xcb_get_selection_owner(conn, arep->atom);
40 srep = xcb_get_selection_owner_reply(conn, sck, NULL);
41 taken = srep->owner == w;
47 xcb_destroy_window(conn, w);