diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2019-03-11 14:27:04 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2019-04-09 19:27:54 +0000 |
commit | 1d1dcd8d6c64a35b94b351f72cc447771834df49 (patch) | |
tree | 39a31bda1054a1206d595a5fde12d8fc739e77be /src/widgets/kernel/qopenglwidget.cpp | |
parent | 1029a2e01051cd35452941e7b49b36520481cdf0 (diff) |
Fix context loss in QOpenGLWidget upon tlw change with AA_ShareOpenGLContexts
The logic introduced in 2ea90c56 has an issue: it resets (destroy the
context and co.) upong TLW change even when AA_ShareOpenGLContexts is set,
and that is just wrong and goes against what the docs claim.
Fixes: QTBUG-74307
Change-Id: Ib519045c1d9842664cbe602d4e6425660cf638b5
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/widgets/kernel/qopenglwidget.cpp')
-rw-r--r-- | src/widgets/kernel/qopenglwidget.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/widgets/kernel/qopenglwidget.cpp b/src/widgets/kernel/qopenglwidget.cpp index 89f860150f..7aef74c507 100644 --- a/src/widgets/kernel/qopenglwidget.cpp +++ b/src/widgets/kernel/qopenglwidget.cpp @@ -1448,7 +1448,8 @@ bool QOpenGLWidget::event(QEvent *e) { // Special case: did grabFramebuffer() for a hidden widget that then became visible. // Recreate all resources since the context now needs to share with the TLW's. - d->reset(); + if (!qGuiApp->testAttribute(Qt::AA_ShareOpenGLContexts)) + d->reset(); } if (!d->initialized && !size().isEmpty() && window()->windowHandle()) { d->initialize(); |