XMLWordPrintable

Details

    • Technical task
    • Resolution: Unresolved
    • P1: Critical
    • None
    • QPA: Android
    • None
    • Android
    • 2025wk02s3FOQtforAndroid, 2025wk04s3FOQtforAndroid
    • 2d2b9fea7 (dev)

    Description

      Whenever we an orientation change in an Android app, it's quite noticeable and very often there will be a flicker(s), sometimes right before the geometry starts to change from portrait ↔ landscape or vise versa, and right, during and after the change as well.

      The cause seems to be wrong order of geometry change between Java (under QtLayout.onMeasure(), QtLayout.onLayout() and QtRootLayout.onSizeChange()), and C++ size when the screen geometry and available geometry are also emitted.

      Potentially as well is the existence of some circular geometry changes, where after the size of the app changes in Java side, it notifies C+, then C+ changes it's geometry and draw changes, then tries to set the geometry back Java as if the change started from C++.

      Below is the current transition frames:

      It is also good to note that this bug happens more often when changing from portrait to landscape compared to landscape to portrait, but it's valid for both cases. For reproduction use fullscreen-transition-flicker-bug.zip.

      Places to look at when debugging this:

      • QtRootLayout.onSizeChanged()
      • QtLayout.onLayout() which is invoked after QtLayout.onMeasure()
      • QtWindow.setGeometry()
      • androidjnimain.cpp:setDisplayMetrics()
      • QAndroidPlatformScreen::setAvailableGeometry() and QPlatformScreen::resizeMaximizedWindows()

      Similar or duplicate bugs:

      Outcome

      Have Android apps change orientation with minimum size calls, without flicker or rendering artifacts.

      Make sure this still works for https://github.com/qt/qtdoc/tree/6.9/examples/demos/windowembedding.

      Attachments

        1. fullscreen-transition-flicker-bug.zip
          4 kB
          Assam Boudjelthia
        2. image-2025-01-10-14-19-06-685.png
          1.10 MB
          Assam Boudjelthia
        3. orientation-change-flicker-bug.mov
          8.81 MB
          Assam Boudjelthia

        Issue Links

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

          Activity

            People

              assam Assam Boudjelthia
              assam Assam Boudjelthia
              Votes:
              3 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There is 1 open Gerrit change