Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.9.4, 5.9.5, 5.10, 5.11, 5.12.0
-
None
-
Windows 7, 10
Description
Using a QTimer to update QOpenGLWidget via update() calls, when combined with sharing OpenGL contexts, results in a black screen after a hibernate/resume. It is somewhat dependent on monitor configurations. I have seen in on many combinations of screens, but not all.
A simple way to reproduce (on Windows, Mac is similar):
- Start with the hellogl2 example.
- Add QApplication::setAttribute(Qt::AA_ShareOpenGLContexts); in main before anything else.
- Add a QTimer in the QOpenGLWidget derived class that calls update(). 20 times a second is fine, but I've tested to very slow and very fast.
- Run, note program works fine.
- Hibernate.
- Upon awaken, the app is drawing garbage.
This has been observed on Win7, Win10, many combinations, makes, and models of PCs, desktops, laptops, graphics cards. It is somewhat dependent on monitor config, but seems to happen on most, so it should be easy to find.
This works if everything is taken out of the QOpenGLWidget, so it does no OpenGL calls.
It does require the QTimer and the ShareOpenGLContexts, even though no contexts are shared.