Go to file
Ivan Solovev 79fb80152f Android: make sure that orientationChange is reported after resize
On Android orientation changes are reported from the
DisplayListener.onDisplayChanged() method, while the screen size
changes are reported from QtLayout.onSizeChanged().
In practice these callbacks come in random order, so rotating the
screen multiple times might result in inconsistent order of signals
and events.

This patch makes sure that size change events always happen before
orientation changes. This is done by caching the new orientation
values and reporting them only when needed. At this point we also
need to use QMetaObject::invokeMethod() for orientation change,
like it is done for geometry change. Otherwise the orientation
update can still be processed earlier than the geometry change.

Also note that at some point we might get an orientation change
without a size change (for example Qt::LandscapeOrientation ->
Qt::InvertedLandscapeOrientation). That is the reason for
isSimilarRotation() helper function.

As a drive-by: ignore size changes with inconsistent values when window
size is reported to have old orientation, while the screen has already
been rotated. In such cases a new size change will be triggered shortly
with normal value.

Task-number: QTBUG-94459
Pick-to: 6.3 6.2 5.15
Change-Id: I5c98e526d0370d380344b2297169d5e0c0ee8ea7
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-03-04 02:37:11 +01:00
.github/workflows Repair github action workflow 2021-11-10 18:57:33 +01:00
bin Provide a qtpaths wrapper script when cross-building Qt 2021-11-08 13:41:03 +01:00
cmake CMake: Generate wrapper shell scripts for all hosts when requested 2022-03-04 01:58:10 +01:00
coin coin: Ensure we configure repos with CMake verbosity set to STATUS 2022-03-04 00:21:44 +01:00
config.tests CMake: remove unused config.tests (atomicfptr, avx512 and stl) 2022-02-15 09:20:34 -03:00
dist Add Qt 6.0.0 changes file 2020-11-16 10:02:08 +02:00
doc Doc: Add \include snippets with optional parameters 2022-02-28 12:39:55 +01:00
examples Avoid using deprecated API in the icons example 2022-02-24 20:17:41 +01:00
lib
libexec Install 3rdparty headers for static builds 2022-02-19 01:52:32 +01:00
mkspecs qmake: Enforce linker response files for WebAssembly on Windows 2022-02-21 12:37:19 +01:00
qmake qmake: Fix overlong command lines for static Qt builds on Windows 2022-02-21 12:37:19 +01:00
src Android: make sure that orientationChange is reported after resize 2022-03-04 02:37:11 +01:00
tests Add literal operators for QLatin1String and QLatin1Char 2022-03-04 01:58:10 +01:00
util pro2cmake: Fix indentation of INSTALL_EXAMPLESDIR assignment 2022-03-03 15:56:08 +01:00
.cmake.conf Bump version to 6.4.0 2022-01-31 17:20:06 +02:00
.gitattributes Give batch files CRLF line endings 2020-11-04 15:02:29 +00:00
.gitignore Assume qhelpgenerator in libexec instead of bin 2021-11-08 19:27:32 +01:00
.lgtm.yml Skip LGTM analysis for the bootstrap library and tools 2020-07-16 01:04:34 +02:00
.tag
CMakeLists.txt Use REALPATH based check for symbolic links on Windows 2022-01-07 14:31:38 +01:00
conanfile.py Conan: Include Android specific option values in 'package_id' 2022-03-01 00:01:04 +00:00
config_help.txt configure: CMake: Add -no-prefix option 2022-02-24 19:46:01 +01:00
configure Remove unsupported, host-related options from configure shell script 2021-08-05 02:44:27 +02:00
configure.bat configure.bat: Fix call without arguments 2022-02-16 12:05:48 +01:00
configure.cmake CMake: Rename FindZSTD to FindWrapZSTD 2022-02-28 23:08:20 +01:00
dependencies.yaml Re-add dependencies.yaml now that qt5.git wip/qt6 builds fine 2019-09-18 13:19:31 +02:00
LICENSE.FDL Remove trailing whitespace in LICENSE.FDL 2021-11-26 18:28:49 +01:00
LICENSE.GPL2
LICENSE.GPL3
LICENSE.GPL3-EXCEPT
LICENSE.LGPL3
LICENSE.QT-LICENSE-AGREEMENT Update LICENSE.QT-LICENSE-AGREEMENT 2022-02-16 17:19:34 +02:00
qt_cmdline.cmake configure: CMake: Add -no-prefix option 2022-02-24 19:46:01 +01:00
sync.profile Network: Use public suffix database in DAFSA format 2022-02-24 19:36:26 +01:00