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

[Wayland] Embedded window does not receive keyboard focus

    XMLWordPrintable

Details

    • Linux/Wayland

    Description

      Code

      import QtQuick
      import QtQuick.Controls.Basic
      
      Window {
          id: outerWindow
          width: 800
          height: 600
          visible: true
          color: "orange"
      
          Row {
              anchors.bottom: parent.bottom
              TextField {}
              Button {
                  text: "Click Me"
                  onClicked: console.log("Outer button clicked")
              }
          }
      
          WindowContainer {
              window: Window {
                  width: 640
                  height: 480
                  visible: true
                  color: "cyan"
      
                  Row {
                      anchors.bottom: parent.bottom
                      TextField {}
                      Button {
                          text: "Click Me"
                          onClicked: console.log("Inner button clicked")
                      }
                  }
              }
          }
      }
      

      Steps to reproduce

      1. Run the code above
      2. Click the 2 Buttons
      3. Try to enter text into the 2 TextFields

       

      Outcomes

      • (XCB and Wayland) Both buttons can be clicked (Expected)
      • (XCB only) Both TextFields can receive text input (Expected)
      • (Wayland) Only the "outer" TextField can receive text input. Clicking the "inner" TextField does not give it the coloured border to indicate focus, and typing does not input anything (Not expected)

       

      Notes

      The above example uses the new Window.parent property introduced in Qt 6.7. However, older versions of Qt can also call QQuickWindow::setParent() from C++ (edit: Updated the example to use the WindowContainer property which has replaced the preliminary 'parent' property in 6.8)

      Attachments

        Issue Links

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

          Activity

            People

              qt.team.graphics.and.multimedia Qt Graphics Team
              skoh-qt Sze Howe Koh
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes