qt6-bb10/tests/auto/gui/kernel
Tor Arne Vestbø c97e58bb61 Reset QWindow positionPolicy on destroy
If a window is positioned with setFramePosition, we reflect that to
the platform window via QPlatformWindow::setGeometry(), but with the
QWindowPrivate::positionPolicy set to WindowFrameInclusive. On the
platform side the position policy is read from QWindowPrivate to
determine how to interpret the incoming geometry.

When the resulting geometry is applied to the native window,
it's reflected through QPlatformWindow::geometry() and reported
back via QWSI::handleGeometryChange() as client geometry, ie.
without the frame margins.

If the platform layer later interprets this geometry in
combination with the window's positionPolicy, it will incorrectly
position the frame top left at the point of the client geometry's
top left.

It would make sense to reset the window's positionPolicy at
the point of QGuiApplicationPrivate::processGeometryChangeEvent,
but doing so might break situations where there's another in
flight geometry request.

What we can do as a first step is reset the positionPolicy when
the platform window is destroyed. This ensures that the next
time the platform window is created it will be placed at the
same position, even if the initial position was requested via
the setFramePosition() API.

Change-Id: Ic555f19884ccd68c46421d0fe666717170ba7638
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 11a09a9bd0a7e899a918b078a94c6c3b82240dee)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 17:40:05 +00:00
..
noqteventloop Change license for tests files 2024-02-04 09:56:42 +01:00
qaction Change license for tests files 2024-02-04 09:56:42 +01:00
qactiongroup Change license for tests files 2024-02-04 09:56:42 +01:00
qaddpostroutine Change license for tests files 2024-02-04 09:56:42 +01:00
qbackingstore tests: extend tst_QBackingStore::flush() 2024-08-12 09:43:38 +00:00
qclipboard Change license for tests files 2024-02-04 09:56:42 +01:00
qcursor Change license for tests files 2024-02-04 09:56:42 +01:00
qdrag Change license for tests files 2024-02-04 09:56:42 +01:00
qevent Fix test compilation issues with QtLite configuration 2024-05-06 14:29:02 +00:00
qfileopenevent Tests: make some QFile::open calls fail 2024-04-13 01:36:06 +02:00
qguiapplication Don't quit automatically via QEventLoopLocker if there are open windows 2024-04-29 14:26:38 +00:00
qguichronotimer Add QChronoTimer, a timer with nanoseconds precision 2024-03-03 19:56:55 +02:00
qguieventdispatcher tst_QEventDispatcher: port to QTEST_THROW_ON_FAIL 2024-06-18 08:09:13 +00:00
qguieventloop CMake: Make gui tests standalone projects 2023-07-05 15:09:32 +02:00
qguimetatype Change license for tests files 2024-02-04 09:56:42 +01:00
qguitimer tst_QTimer: refactor CMake code 2023-11-22 06:34:29 +02:00
qguivariant Change license for tests files 2024-02-04 09:56:42 +01:00
qhighdpi tst_qhighdpi: Write screen config to temporary directory 2024-08-15 08:37:32 +00:00
qinputdevice Change license for tests files 2024-02-04 09:56:42 +01:00
qinputmethod Change license for tests files 2024-02-04 09:56:42 +01:00
qkeyevent Change license for tests files 2024-02-04 09:56:42 +01:00
qkeysequence Change license for tests files 2024-02-04 09:56:42 +01:00
qmouseevent Change license for tests files 2024-02-04 09:56:42 +01:00
qmouseevent_modal Change license for tests files 2024-02-04 09:56:42 +01:00
qopenglwindow Change license for tests files 2024-02-04 09:56:42 +01:00
qpalette Change license for tests files 2024-02-04 09:56:42 +01:00
qpixelformat Change license for tests files 2024-02-04 09:56:42 +01:00
qrasterwindow Remove extra semi-colons 2024-02-06 20:17:18 +09:00
qscreen Change license for tests files 2024-02-04 09:56:42 +01:00
qshortcut Change license for tests files 2024-02-04 09:56:42 +01:00
qsurfaceformat Change license for tests files 2024-02-04 09:56:42 +01:00
qtouchevent Change license for tests files 2024-02-04 09:56:42 +01:00
qwindow Reset QWindow positionPolicy on destroy 2024-08-28 17:40:05 +00:00
CMakeLists.txt Add QChronoTimer, a timer with nanoseconds precision 2024-03-03 19:56:55 +02:00