Attempt to make the positioning test of QWindow more reliable

The part of the test that verifies that setFramePosition moves the window
successfully appears to be very unreliable in the CI system. The "tested"
frame position is calculated to be at (40, 40) relative to the top left
of the available screen geometry, which can be non-zero due to task bars
and similar system ui elements. However that position appears to be
unreliable in the sense that the window manager doesn't seem to always
respect that. So instead let's try placing the window (by frame position)
in the center of the screen instead.

Change-Id: I96fe6c37e748fc18262632b5effe5a9e90dc0028
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
bb10
Simon Hausmann 2014-12-09 10:46:20 +01:00 committed by Simon Hausmann
parent 66e48d2c2f
commit 9ccd359be8
1 changed files with 1 additions and 1 deletions

View File

@ -301,7 +301,7 @@ void tst_QWindow::positioning()
// if our positioning is actually fully respected by the window manager
// test whether it correctly handles frame positioning as well
if (originalPos == geometry.topLeft() && (originalMargins.top() != 0 || originalMargins.left() != 0)) {
QPoint framePos = QPlatformScreen::platformScreenForWindow(&window)->availableGeometry().topLeft() + QPoint(40, 40);
QPoint framePos = QPlatformScreen::platformScreenForWindow(&window)->availableGeometry().center();
window.reset();
window.setFramePosition(framePos);