QTC_EXPORT xcb_screen_t* (qtcX11GetScreen)(int screen_no) { if (screen_no == -1 || screen_no == qtc_default_screen_no) { return qtc_default_screen; } if (qtcUnlikely(!qtc_xcb_conn)) { return NULL; } return screen_of_display(qtc_xcb_conn, screen_no); }
QTC_EXPORT void qtcX11InitXcb(xcb_connection_t *conn, int screen_no) { if (qtcUnlikely(qtc_xcb_conn) || !conn) { return; } if (screen_no < 0) { screen_no = 0; } qtc_xcb_conn = conn; qtc_default_screen_no = screen_no; qtc_default_screen = screen_of_display(conn, screen_no); if (qtc_default_screen) { qtc_root_window = qtc_default_screen->root; } const size_t base_len = strlen("_NET_WM_CM_S"); sprintf(wm_cm_s_atom_name + base_len, "%d", screen_no); qtcX11GetAtoms(_QTC_X11_ATOM_NUMBER, qtc_x11_atoms, qtc_x11_atom_names, true); qtcX11ShadowInit(); }
/** * Get pointer to the default xcb screen */ xcb_screen_t* connection::screen() { if (m_screen == nullptr) m_screen = screen_of_display(default_screen()); return m_screen; }