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

Subsurfaces under dialogs don't have the QEvent::Exposed event emitted

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.15.4, 6.1.0 RC
    • 5.15.0
    • QPA: Wayland
    • None
    • Linux/Wayland
    • e20e1d506d627a53d9d7bf7794b93bf9e8b9bedb (qt/qtwayland/dev) 7d7ac7f0a4bd6a7956448ddb0ba44c12755dca2e (qt/qtwayland/5.15)

    Description

      I've been working on porting OBS Studio to be a native Wayland client, and I'm seeing what I believe to be an odd, potentially buggy behavior.

      OBS Studio has this OBSQTDisplay class that is a native QWidget subclass, and renders the contents of the different sources (webcam, screen capture, etc) into them. The graphics (GLX / EGL / WGL / etc) infrastructure is created only if  this particular widget's windowHandle() is exposed. On X11, this seems to be a reasonable check, however on Wayland it is not.

       

      I've added an event filter to all the places this widget is created, and found some interesting facts:

       

       * When in a dialog, QWidget::resizeEvent() is called, and windowHandle()'s QWindow::visibleChanged event is fired, but windowHandle()->isExposed() returns false in both places.

       * The QEvent::PlatformSurface event is always properly received by the event filter, regardless of being inside a window or a dialog.

       * I've checked with a timer and, when inside a dialog, this native widget's windowHandle never becomes exposed until I create a wl_egl_window with the widget's wl_surface.

       * The QEvent::Expose event is sent when the QWidget is created with the Qt::Window flag.

      You can verify the code at https://github.com/obsproject/obs-studio/pull/2484

      Let me know if there's any other information I can provide to help tracking down this issue.

      Attachments

        For Gerrit Dashboard: QTBUG-86176
        # Subject Branch Project Status CR V

        Activity

          People

            qt.team.graphics.and.multimedia Qt Graphics Team
            feaneron Georges Basile Stavracas Neto
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes