Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-72962

Shared OpenGL Context and QTimer result in black windows after suspend

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.9.4, 5.9.5, 5.10, 5.11, 5.12.0
    • GUI: OpenGL
    • None
    • Windows 7, 10
    • macOS, Windows

    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):

      1. Start with the hellogl2 example.
      2. Add QApplication::setAttribute(Qt::AA_ShareOpenGLContexts); in main before anything else.
      3. 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.
      4. Run, note program works fine.
      5. Hibernate.
      6. 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. 

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            lagocs Laszlo Agocs
            chrislomont Chris Lomont
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes