diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2020-06-30 17:36:11 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2020-06-30 18:54:57 +0200 |
commit | 9db36a714315fbdb1a5bc3b4d99dbb0e8f6d594f (patch) | |
tree | da35a858daeadfbce5442299ba57bd3f3a5b34e5 | |
parent | 69d581736c3aa82aa42dc5a343a0ba494b38e51e (diff) |
glx: Pull out screen numnber from GLXFBConfig instead of QXcbScreen
Change-Id: I6b87bb1c3c501613bc147c5f88e0f2d2222b0a50
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r-- | src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp index 14f5d975c4..ca9cb4c86a 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp @@ -473,10 +473,16 @@ void QGLXContext::init(QXcbScreen *screen, QPlatformOpenGLContext *share, const 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; int numConfigs = 0; 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) { qWarning("QGLXContext: Failed to find config"); return; |