XMLWordPrintable

    • Icon: Technical task Technical task
    • Resolution: Unresolved
    • Icon: P1: Critical P1: Critical
    • None
    • QPA: Android
    • None
    • Android
    • 2025wk02s3FOQtforAndroid, 2025wk04s3FOQtforAndroid, 2025wk06s1QtforAndroid, 2025wk08s1QtforAndroid, 2025wk16s1QtforAndroid, 2025wk22s1-2QtforAndroid, 2025wk28s2QtforAndroid, 2025wk34s2QtforAndroid
    • 2d2b9fea7 (dev)

      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.

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

            assam Assam Boudjelthia
            assam Assam Boudjelthia
            Votes:
            5 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:

                There is 1 open Gerrit change