From 2c9bee719e080fc7a6ea5acbaf812fea4ad513d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Tue, 25 Sep 2007 10:14:57 +0000 Subject: [PATCH] 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 --- compositingprefs.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compositingprefs.cpp b/compositingprefs.cpp index bf6c6e4090..ed150d94bc 100644 --- a/compositingprefs.cpp +++ b/compositingprefs.cpp @@ -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 }