summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2014-11-18 16:10:51 +0000
committerMichael Meeks <michael.meeks@collabora.com>2014-11-18 16:13:18 +0000
commit6f5a948612a541fff845cbef44e79adaf9c45793 (patch)
treeef4d78b816d31ff4ccf644d68d5fabbc8426ea72 /vcl
parent620156f516db5f20cd97bcf962934e51f28b4d40 (diff)
vcl: check the OpenGL drawable as well as the context.
Change-Id: Idac493dfb3239f7ae5b5e49158d79c4f3e707509
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/opengl/OpenGLContext.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index d30ac171da83..6267a9f0e517 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -1137,7 +1137,8 @@ SystemWindowData OpenGLContext::generateWinData(vcl::Window* pParent, bool)
void OpenGLContext::makeCurrent()
{
#if defined( WNT )
- if (wglGetCurrentContext() == m_aGLWin.hRC)
+ if (wglGetCurrentContext() == m_aGLWin.hRC &&
+ wglGetCurrentDC() == m_aGLWin.hDC)
{
SAL_INFO("vcl.opengl", "OpenGLContext::makeCurrent(): Avoid setting the same context");
}
@@ -1151,11 +1152,13 @@ void OpenGLContext::makeCurrent()
#elif defined( IOS ) || defined( ANDROID )
// nothing
#elif defined( UNX )
- if (glXGetCurrentContext() == m_aGLWin.ctx)
+ GLXDrawable nDrawable = mbPixmap ? m_aGLWin.glPix : m_aGLWin.win;
+ if (glXGetCurrentContext() == m_aGLWin.ctx &&
+ glXGetCurrentDrawable() == nDrawable)
{
SAL_INFO("vcl.opengl", "OpenGLContext::makeCurrent(): Avoid setting the same context");
}
- else if (!glXMakeCurrent( m_aGLWin.dpy, mbPixmap ? m_aGLWin.glPix : m_aGLWin.win, m_aGLWin.ctx ))
+ else if (!glXMakeCurrent( m_aGLWin.dpy, nDrawable, m_aGLWin.ctx ))
SAL_WARN("vcl.opengl", "OpenGLContext::makeCurrent failed");
#endif
}