summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp
diff options
context:
space:
mode:
authorSandro Mani <manisandro@gmail.com>2015-02-02 11:15:13 +0100
committerShawn Rutledge <shawn.rutledge@digia.com>2015-02-04 14:40:56 +0000
commitcf1c4d810a043ca5fe60623569c131a2a7a417df (patch)
tree248c058dc4c6e73c7a5cefdf585dd491a59fd5d8 /src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp
parent348ac43821ad3b0251d383d82fb02b8ab52ddbeb (diff)
QXcbWindow: use an accessor to get the screen instead of storing it
Applications which construct a window with one screen configuration and show the window later on after a screen configuration change crash because the QXcbWindow::m_screen still pointed to the screen present at the time of window construction. In QXcbWindow::handleConfigureNotifyEvent the m_screen should get updated with the new screen, but I didn't see that method called in the scenario outlined. Looking at the other platform backends, I however see that they take the screen directly from the QPlatformWindow instead of storing the instance, hence this patch which makes QXcbWindow do the same. Change-Id: I13759a5939315c3aac36ec6e2c25bd0a6d7b1c35 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp')
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp
index 8aabde8129..8d5bfb13d3 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp
@@ -62,7 +62,10 @@ void QXcbGlxWindow::resolveFormat()
void *QXcbGlxWindow::createVisual()
{
- return qglx_findVisualInfo(DISPLAY_FROM_XCB(m_screen), m_screen->screenNumber(), &m_format);
+ QXcbScreen *scr = xcbScreen();
+ if (!scr)
+ return Q_NULLPTR;
+ return qglx_findVisualInfo(DISPLAY_FROM_XCB(scr), scr->screenNumber(), &m_format);
}
QT_END_NAMESPACE