qt5base-lts/src
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
..
3rdparty Update bundled libjpeg-turbo to version 2.1.3 2022-03-02 17:58:07 +01:00
android Android: make sure that orientationChange is reported after resize 2022-03-04 02:37:11 +01:00
concurrent Do not highlight the Image Scaling Example anymore in Qt Creator 2022-02-17 18:16:42 +01:00
corelib Add literal operators for QLatin1String and QLatin1Char 2022-03-04 01:58:10 +01:00
dbus CMake: Document source file properties 2022-02-15 15:44:51 +01:00
entrypoint QtBase: replace windows.h with qt_windows.h 2021-11-23 12:53:46 +08:00
gui QBitmap::fromPixmap: document \since 2022-03-04 01:58:10 +01:00
network Network: Use system publicsuffix database copy when available 2022-03-03 15:56:09 +01:00
opengl Fix painting clipping glitches with fractional scaling 2022-03-02 13:58:10 +00:00
openglwidgets Migrate to autogenerated cpp exports 2021-06-25 19:33:12 +02:00
platformsupport Make sure all qtbase private headers include at least one other 2022-02-24 12:07:00 -08:00
plugins Android: make sure that orientationChange is reported after resize 2022-03-04 02:37:11 +01:00
printsupport Fix assert showing default-constructed QPrintPreviewDialog 2022-02-28 12:39:54 +01:00
sql Treat invalid Q(Date)?Time as null when used as an SQL value 2022-02-21 20:37:28 +01:00
testlib Fix QTest::toString() over QT_TYPESAFE_FLAGS QFlags 2022-03-04 01:26:53 +01:00
tools Bootstrap: Make compiler warnings fatal 2022-03-02 11:03:44 +01:00
widgets Fix Q_FLAG declaration over enumerations 2022-03-02 19:45:12 +01:00
xml Make sure all qtbase private headers include at least one other 2022-02-24 12:07:00 -08:00
CMakeLists.txt Make it possible to disable the PrintSupport module 2021-02-09 09:17:21 +01:00