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

xcb plugin doesn't fire a QExposeEvent when hiding platform window

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2: Important P2: Important
    • None
    • 5.4.0 Beta
    • QPA: X11/XCB
    • None

      The xcb qpa does not fire off a QExposeEvent when the platform window is hidden. This is important for Qt3D as we need to use the QExposeEvent's to be able to know when to render to the window from another thread.

      Since the platform window is not protected in any way it is possible for it to be pulled out from under us when rendering on a different thread which can lead to a crash in QOpenGLContext::swapBuffers() and QOpenGLContext::makeCurrent().

      By responding to the QExposeEvents in a synchronous manner, we can safely keep rendering when the window is exposed and safely shutdown rendering when the window is hidden. This is especially needed when the window is hidden during QWindow::destroy() which may be called as a result of closing the window or the window being attached to a different screen.

      It seems that the windows QPA, plugin fires off a QExposeEvent with an empty QRegion during QPlatformWindow::setVisible(false) but the xcb plugin does not. This makes it impossible to react accordingly.

      I have a patch I'm testing and will push to gerrit shortly.

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

            seanharmer Sean Harmer
            seanharmer Sean Harmer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes