Skip to content

Commit

Permalink
Remove side effects of QGLXContext::queryDummyContext()
Browse files Browse the repository at this point in the history
Task-number: QTBUG-34782

Change-Id: I411c89238b3002a118b1750af0157ccff5c78712
Reviewed-by: Gunnar Sletta <[email protected]>
  • Loading branch information
seanharmer authored and The Qt Project committed Nov 14, 2013
1 parent 038b0da commit 9f75292
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/plugins/platforms/xcb/qglxintegration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,11 @@ void QGLXContext::queryDummyContext()
if (skip)
return;

QOpenGLContext *oldContext = QOpenGLContext::currentContext();
QSurface *oldSurface = 0;
if (oldContext)
oldSurface = oldContext->surface();

QOffscreenSurface surface;
surface.create();
QOpenGLContext context;
Expand All @@ -446,6 +451,9 @@ void QGLXContext::queryDummyContext()
break;
}
}

if (oldContext && oldSurface)
oldContext->makeCurrent(oldSurface);
}

bool QGLXContext::supportsThreading()
Expand Down

0 comments on commit 9f75292

Please sign in to comment.