24 QXcbScreen *scr = xcbScreen();
26 return QXcbWindow::createVisual();
28 qCDebug(lcQpaGl) <<
"Requested format before FBConfig/Visual selection:" << m_format;
30 Display *dpy =
static_cast<Display *>(scr->connection()->xlib_display());
31 const char *glxExts = glXQueryExtensionsString(dpy, scr->screenNumber());
34 qCDebug(lcQpaGl,
"Available GLX extensions: %s", glxExts);
35 if (strstr(glxExts,
"GLX_EXT_framebuffer_sRGB") || strstr(glxExts,
"GLX_ARB_framebuffer_sRGB"))
36 flags |= QGLX_SUPPORTS_SRGB;
39 const auto formatBackup = m_format;
40 XVisualInfo *visualInfo = qglx_findVisualInfo(dpy, scr->screenNumber(), &m_format, GLX_WINDOW_BIT, flags);
42 qCDebug(lcQpaGl) <<
"No XVisualInfo for format" << m_format;
44 m_format = formatBackup;
45 return QXcbWindow::createVisual();
47 const xcb_visualtype_t *xcb_visualtype = scr->visualForId(visualInfo->visualid);
50 qCDebug(lcQpaGl) <<
"Got format:" << m_format;
52 return xcb_visualtype;