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

Overriding swap interval for Wayland EGL windows doesn't work

    XMLWordPrintable

Details

    • Linux/Wayland
    • 6d7bf2a49 (dev), 6a8284f36 (6.7), 2ec6b4d3e (6.6), b505f56c1 (tqtc/lts-6.5)

    Description

      I want to bypass this slowdown code: https://github.com/qt/qtwayland/blob/92ba57d7ceca3d9d072ee121ab44eff17637cbec/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp#L371-L375

      I do the following thing:

      #include <QtWidgets>
      
      int main (int argc, char** argv) {
        QApplication app(argc, argv);
        QSurfaceFormat fmt = QSurfaceFormat::defaultFormat();
        fmt.setSwapInterval(0);
        QSurfaceFormat::setDefaultFormat(fmt);
        QWidget widget;
        widget.show();
        qWarning() << widget.windowHandle()->format().swapInterval();
        return app.exec();
      }
      

      And run with QT_WIDGETS_RHI=1 environment variable set. Result is 1 while I expect it to be 0.

      My guess is it's because window()->requestedFormat() is not provided here as third argument so it uses a default-constructed QSurfaceFormat that defaults to 1.

      Attachments

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

        Activity

          People

            qt.team.graphics.and.multimedia Qt Graphics Team
            ilya-fedin Ilya Fedin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: