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

[Reg 6.6 -> 6.7] Window resizing on Android is broken

    XMLWordPrintable

Details

    • Android
    • a6b78e6f4 (dev), 52bb40a08 (6.8), d977924ac (6.7)
    • 2024wk24s2FOQtforAndroid

    Description

      Since Qt 6.7.0 the resizing of the Application WIndow is somewhat broken on Android.

      When using either the pop-up view or split screen view the windows does not get resized correctly under all circumstances. Whereas this worked before with Qt 6.6.2.

      This seems to be caused by the check in QtRootLayout::onSizeChanged

              if ((realMetrics.widthPixels > realMetrics.heightPixels) != (w > h)) {
                  // This is an intermediate state during display rotation.
                  // The new size is still reported for old orientation, while
                  // realMetrics contain sizes for new orientation. Setting
                  // such parameters will produce inconsistent results, so
                  // we just skip them.
                  // We will have another onSizeChanged() with normal values
                  // a bit later.
                  return;
              } 
      

      Once the aspect ratio of the Application Window differs from the ratio of the screen, it will not get resized at all. The check was (re)introduced in https://codereview.qt-project.org/c/qt/qtbase/+/522806 to QtLayout and moved to QtRootLayout in https://codereview.qt-project.org/c/qt/qtbase/+/506555.

      I have attached a simple MWE consisting of 3 rectangles of equal height and two quick screencasts showing the issue. In resizeBroken_671.mp4 the Application Window resizes correctly when it gets taller but once it gets small only the top most rectangle is visible and part of the second one. The third is not visible at all. resizeWorking_662.mp4 shows the correct behavior with Qt 6.6.2.

      Attachments

        1. App.qml
          0.3 kB
        2. resizeBroken_671.mp4
          7.26 MB
        3. resizeWorking_662.mp4
          7.11 MB

        Issue Links

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

          Activity

            People

              qtandroidteam Qt Android Team
              janmoeller Jan Möller
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There is 1 open Gerrit change