diff --git a/src/SFML/Window/GlContext.cpp b/src/SFML/Window/GlContext.cpp index 3ec2214cd..8539083c9 100644 --- a/src/SFML/Window/GlContext.cpp +++ b/src/SFML/Window/GlContext.cpp @@ -123,8 +123,9 @@ bool GlContext::SetActive(bool active) if (MakeCurrent()) { // If this is the first context to be activated on this thread, make - // it the reference context for the whole thread - if (!threadContext) + // it the reference context for the whole thread. + // referenceContext must *not* be the threadContext of the main thread + if (!threadContext && (this != &referenceContext)) threadContext = this; return true; diff --git a/src/SFML/Window/Linux/GlxContext.cpp b/src/SFML/Window/Linux/GlxContext.cpp index 44c72412e..28d24d020 100644 --- a/src/SFML/Window/Linux/GlxContext.cpp +++ b/src/SFML/Window/Linux/GlxContext.cpp @@ -62,14 +62,7 @@ myOwnsWindow(true) CreateContext(shared, VideoMode::GetDesktopMode().BitsPerPixel, ContextSettings(0, 0, 0)); // Activate the context - if (shared) - SetActive(true); - - // -- Warning -- - // The "if (shared)" condition fixes this bug: - // http://www.sfml-dev.org/forum/viewtopic.php?p=20767#20767 - // However, it was already there before and removed at revision 1236, - // but without any comment... so it might cause other problems in the future + SetActive(true); } diff --git a/src/SFML/Window/Win32/WglContext.cpp b/src/SFML/Window/Win32/WglContext.cpp index c51645800..5f2da0710 100644 --- a/src/SFML/Window/Win32/WglContext.cpp +++ b/src/SFML/Window/Win32/WglContext.cpp @@ -59,14 +59,7 @@ myOwnsWindow (true) CreateContext(shared, VideoMode::GetDesktopMode().BitsPerPixel, ContextSettings(0, 0, 0)); // Activate the context - if (shared) - SetActive(true); - - // -- Warning -- - // The "if (shared)" condition fixes this bug: - // http://www.sfml-dev.org/forum/viewtopic.php?p=20767#20767 - // However, it was already there before and removed at revision 1236, - // but without any comment... so it might cause other problems in the future + SetActive(true); }