From 56900a441de1d4cc896ad1e36a44622ed1598fad Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Tue, 8 Sep 2015 11:46:13 +0100 Subject: tdf#94006 - fix OpenGLContext mis-use in several places. gltf rendering, OpenGL canvas, GL transitions & GL capable (charts) Avoid GLX operations on un-initialized contexts. Change-Id: I7f523640f66ab656896181e5c865879234f6640e --- vcl/source/opengl/OpenGLContext.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'vcl/source/opengl/OpenGLContext.cxx') diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx index d070e3fb3b6b..432241f03817 100644 --- a/vcl/source/opengl/OpenGLContext.cxx +++ b/vcl/source/opengl/OpenGLContext.cxx @@ -1362,11 +1362,14 @@ void OpenGLContext::makeCurrent() TempErrorHandler aErrorHandler(m_aGLWin.dpy, unxErrorHandler); #endif - GLXDrawable nDrawable = mbPixmap ? m_aGLWin.glPix : m_aGLWin.win; - if (!glXMakeCurrent( m_aGLWin.dpy, nDrawable, m_aGLWin.ctx )) + if (m_aGLWin.dpy) { - SAL_WARN("vcl.opengl", "OpenGLContext::makeCurrent failed on drawable " << nDrawable << " pixmap? " << mbPixmap); - return; + GLXDrawable nDrawable = mbPixmap ? m_aGLWin.glPix : m_aGLWin.win; + if (!glXMakeCurrent( m_aGLWin.dpy, nDrawable, m_aGLWin.ctx )) + { + SAL_WARN("vcl.opengl", "OpenGLContext::makeCurrent failed on drawable " << nDrawable << " pixmap? " << mbPixmap); + return; + } } #endif -- cgit