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

focusProxy() isn't set correctly on redirects

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.12.0 Beta 4
    • 5.11.0
    • WebEngine
    • None
    • Archlinux
    • 36d230c44c7e2f6fccf224b4a0ab5efe77117e0a (qt/qtwebengine/5.12)

    Description

      I'd expect the focusProxy() of a QWebEngineView to always be the RVHW, but sometimes this isn't the case. When adding a hack to simplebrowser to print the focusProxy() on a right-click:

      diff --git a/examples/webenginewidgets/simplebrowser/webview.cpp b/examples/webenginewidgets/simplebrowser/webview.cpp
      index fcbb543f..c2fda9e5 100644
      --- a/examples/webenginewidgets/simplebrowser/webview.cpp
      +++ b/examples/webenginewidgets/simplebrowser/webview.cpp
      @@ -176,6 +176,7 @@ QWebEngineView *WebView::createWindow(QWebEnginePage::WebWindowType type)
       
       void WebView::contextMenuEvent(QContextMenuEvent *event)
       {
      +    qDebug() << focusProxy();
           QMenu *menu = page()->createStandardContextMenu();
           const QList<QAction *> actions = menu->actions();
           auto inspectElement = std::find(actions.cbegin(), actions.cend(), page()->action(QWebEnginePage::InspectElement));
      

      then you get what's expected on the Qt webpage: QtWebEngineCore::RenderWidgetHostViewQtDelegateWidget(0x55ee78e3f440).

      However, after going to http://www.qt.io/ (which redirects to https://), the focusProxy() is gone and QWidget(0x0) is printed.

      This also causes the website to not resize correctly anymore when the window is resized:

      Attachments

        Issue Links

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

          Activity

            People

              juri.valdmann Jüri Valdmann (Inactive)
              the compiler Florian Bruhin
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes