Do not swap buffers for non-exposed windows (bug #4911)

pull/2250/head
Andrei Kortunov 6 years ago
parent ddcdbccd84
commit 4aa21b9088

@ -40,6 +40,7 @@
Bug #4876: AI ratings handling inconsistencies
Bug #4877: Startup script executes only on a new game start
Bug #4888: Global variable stray explicit reference calls break script compilation
Bug #4911: Editor: QOpenGLContext::swapBuffers() warning with Qt5
Feature #2229: Improve pathfinding AI
Feature #3442: Default values for fallbacks from ini file
Feature #3610: Option to invert X axis

@ -17,6 +17,7 @@
#include <osgViewer/ViewerBase>
#include <QInputEvent>
#include <QPointer>
#include <QWindow>
#if (QT_VERSION>=QT_VERSION_CHECK(4, 6, 0))
# define USE_GESTURES
@ -518,6 +519,12 @@ bool GraphicsWindowQt::releaseContextImplementation()
void GraphicsWindowQt::swapBuffersImplementation()
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
// QOpenGLContext complains if we swap on an non-exposed QWindow
if (!_widget || !_widget->windowHandle()->isExposed())
return;
#endif
_widget->swapBuffers();
// FIXME: the processDeferredEvents should really be executed in a GUI (main) thread context but

Loading…
Cancel
Save