diff options
author | JoergAtGithub <JoergAtGithub@worldwartweb.com> | 2020-11-24 20:15:17 +0100 |
---|---|---|
committer | Be <be@mixxx.org> | 2020-11-25 12:11:02 -0600 |
commit | 65eb3e6a4494eed9fd99bfb3f34dc2ae00ea08eb (patch) | |
tree | 15f0c1d6496bcc5c9ed71b87d735f742a4bfc1b4 | |
parent | b1dda3152ee7e1abbc10eda941f5e7627e027e3c (diff) |
Fix OpenGL swap buffer issues
-rw-r--r-- | src/waveform/waveformwidgetfactory.cpp | 3 | ||||
-rw-r--r-- | src/widget/wspinny.cpp | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/waveform/waveformwidgetfactory.cpp b/src/waveform/waveformwidgetfactory.cpp index 6ab1089379..4078a571ee 100644 --- a/src/waveform/waveformwidgetfactory.cpp +++ b/src/waveform/waveformwidgetfactory.cpp @@ -713,6 +713,9 @@ void WaveformWidgetFactory::swap() { } QGLWidget* glw = qobject_cast<QGLWidget*>(pWaveformWidget->getWidget()); if (glw != nullptr) { + if (glw->context() != QGLContext::currentContext()) { + glw->makeCurrent(); + } glw->swapBuffers(); } //qDebug() << "swap x" << m_vsyncThread->elapsed(); diff --git a/src/widget/wspinny.cpp b/src/widget/wspinny.cpp index 406750c962..12c19cd5cd 100644 --- a/src/widget/wspinny.cpp +++ b/src/widget/wspinny.cpp @@ -403,6 +403,9 @@ void WSpinny::swap() { if (window == nullptr || !window->isExposed()) { return; } + if (context() != QGLContext::currentContext()) { + makeCurrent(); + } swapBuffers(); } |