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

[5.14 Regression] QWebEnginePage Can Fail to Render

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.14.0 Beta2
    • 5.14.0 Alpha, 5.14.0 RC1, 5.14
    • WebEngine
    • None
    • OpenSUSE Linux, compiled QtWebEngine against Qt 5.13.1 and Qt 5.9.7, the issue occurred with both versions. Tested with my project, viper-browser, and reproduced the issue with Falkon.
    • Linux/X11
    • ae0eea6d5dbbe8570ff5ee2342484a78ad5c92fb (qt/qtwebengine/5.15)

    Description

      When browsing with multiple QWebEngineViews / QWebEnginePages, and one or more of the views have been hidden for ~10-30 seconds, it is very likely that the frame will be lost, and the page can not be rendered without adjusting the size of the viewport, thus forcing a repaint. Generally, around 5 or 6 web views must be active before the issue can be reproduced.

      It is strange because the mouse and keyboard can still interact with the unrendered web page - for example, it is possible to click on a link, open a context menu, etc., but otherwise nothing appears on the screen.

      If a page is in this state and I attempt to load a new URL in the same QWebEngineView/Page, it will also fail to render, unless I adjust the size of the window or container holding the QWebEngineView.

      For now my project is using this uncumbersome hack to fix the rendering issue, although it does not work 100% of the time:

      #if (QTWEBENGINECORE_VERSION >= QT_VERSION_CHECK(5, 14, 0))
      void WebWidget::showEvent(QShowEvent *event)
      {
          const bool updateWebContents = !m_hibernating && m_view && m_page;
          if (updateWebContents)
          {
              if (m_page->lifecycleState() != WebPage::LifecycleState::Active)
                  m_page->setLifecycleState(WebPage::LifecycleState::Active);
          }
      
          QWidget::showEvent(event);
      
          if (updateWebContents && m_view->getProgress() == 100)
          {
              // Hack to force a frame into the view.
              // With QtWebEngine 5.14 it is possible we could otherwise have a dead/blank frame
              m_view->resize(width(), height() * 9 / 10);
              m_view->show();
      
              QTimer::singleShot(15, this, [this](){
                  if (m_hibernating || !m_view || !m_page)
                      return;
      
                  updateGeometry();
      
                  m_view->resize(size());
                  m_view->show();
              });
          }
      }
      #endif

      Would this have been caused by the compositor change (https://codereview.qt-project.org/c/qt/qtwebengine/+/246364 )? QtWebEngine 5.13 and prior versions do not have the issue.

      Attachments

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

        Activity

          People

            allan.jensen Allan Sandfeld Jensen
            lefroid lefroid
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes