glx: Pull out screen numnber from GLXFBConfig instead of QXcbScreen
Change-Id: I6b87bb1c3c501613bc147c5f88e0f2d2222b0a50 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
This commit is contained in:
parent
69d581736c
commit
9db36a7143
@ -473,10 +473,16 @@ void QGLXContext::init(QXcbScreen *screen, QPlatformOpenGLContext *share, const
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int screenNumber = 0;
|
||||||
|
if (glXQueryContext(m_display, context, GLX_SCREEN, &screenNumber) != Success) {
|
||||||
|
qWarning("QGLXContext: Failed to query screen from the provided context");
|
||||||
|
screenNumber = DefaultScreen(m_display);
|
||||||
|
}
|
||||||
|
|
||||||
GLXFBConfig *configs;
|
GLXFBConfig *configs;
|
||||||
int numConfigs = 0;
|
int numConfigs = 0;
|
||||||
static const int attribs[] = { GLX_FBCONFIG_ID, configId, None };
|
static const int attribs[] = { GLX_FBCONFIG_ID, configId, None };
|
||||||
configs = glXChooseFBConfig(m_display, screen->screenNumber(), attribs, &numConfigs);
|
configs = glXChooseFBConfig(m_display, screenNumber, attribs, &numConfigs);
|
||||||
if (!configs || numConfigs < 1) {
|
if (!configs || numConfigs < 1) {
|
||||||
qWarning("QGLXContext: Failed to find config");
|
qWarning("QGLXContext: Failed to find config");
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user