xcb_dri2_authenticate_cookie_t authenticate_cookie;
xcb_dri2_authenticate_reply_t *authenticate = NULL;
xcb_screen_iterator_t s;
+ xcb_screen_t *xcb_screen;
xcb_generic_error_t *error = NULL;
char *device_name;
int fd, device_name_length;
goto free_query;
s = xcb_setup_roots_iterator(xcb_get_setup(scrn->conn));
+ xcb_screen = get_xcb_screen(s, screen);
+ if (!xcb_screen)
+ goto free_query;
driverType = XCB_DRI2_DRIVER_TYPE_DRI;
#ifdef DRI2DriverPrimeShift
#endif
connect_cookie = xcb_dri2_connect_unchecked(scrn->conn,
- get_xcb_screen(s, screen)->root,
+ xcb_screen->root,
driverType);
connect = xcb_dri2_connect_reply(scrn->conn, connect_cookie, NULL);
if (connect == NULL ||
goto close_fd;
authenticate_cookie = xcb_dri2_authenticate_unchecked(scrn->conn,
- get_xcb_screen(s, screen)->root,
+ xcb_screen->root,
magic);
authenticate = xcb_dri2_authenticate_reply(scrn->conn, authenticate_cookie, NULL);