Restore original glx context after using the temporary one for detecting,

this avoids visual freeze when reconfiguring.
CCMAIL: rivolaks@hot.ee


svn path=/trunk/KDE/kdebase/workspace/; revision=716819
This commit is contained in:
Luboš Luňák 2007-09-25 10:14:57 +00:00
parent 8985ca0b7f
commit 2c9bee719e

View file

@ -32,6 +32,10 @@ CompositingPrefs::~CompositingPrefs()
void CompositingPrefs::detect()
{
#ifdef HAVE_OPENGL
// remember and later restore active context
GLXContext oldcontext = glXGetCurrentContext();
GLXDrawable olddrawable = glXGetCurrentDrawable();
GLXDrawable oldreaddrawable = glXGetCurrentReadDrawable();
if( createGLXContext() )
{
detectDriverAndVersion();
@ -39,6 +43,8 @@ void CompositingPrefs::detect()
deleteGLXContext();
}
if( oldcontext != NULL )
glXMakeContextCurrent( display(), olddrawable, oldreaddrawable, oldcontext );
#endif
}