From 24c50f8dcf7fa61ac3c3d4d6295c259a104a2b8c Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Thu, 29 Oct 2015 11:39:14 +0100 Subject: Mirclient: Improved support for autotests Outside qmlscene, a window may be created before its size has been set. So check if the size is valid before using it. Also, allow an app to bypass the adjustment to the requested window size that is normally done in order to leave room for the system's status panel. Such adjustment does not make sense in the context of autotests, and would often cause false test failures. Change-Id: I1627a2e4c37c68ac61c4976be5b73045eb2bb989 Reviewed-by: Paul Olav Tvete --- src/plugins/platforms/mirclient/qmirclientwindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms/mirclient') diff --git a/src/plugins/platforms/mirclient/qmirclientwindow.cpp b/src/plugins/platforms/mirclient/qmirclientwindow.cpp index f3fd1e756d..3d1e5377e5 100644 --- a/src/plugins/platforms/mirclient/qmirclientwindow.cpp +++ b/src/plugins/platforms/mirclient/qmirclientwindow.cpp @@ -158,7 +158,7 @@ QMirClientWindow::QMirClientWindow(QWindow* w, QSharedPointerid = id++; // Use client geometry if set explicitly, use available screen geometry otherwise. - QPlatformWindow::setGeometry(window()->geometry() != screen->geometry() ? + QPlatformWindow::setGeometry(window()->geometry().isValid() && window()->geometry() != screen->geometry() ? window()->geometry() : screen->availableGeometry()); createWindow(); DLOG("QMirClientWindow::QMirClientWindow (this=%p, w=%p, screen=%p, input=%p)", this, w, screen, input); @@ -198,6 +198,8 @@ void QMirClientWindowPrivate::destroyEGLSurface() // we need to guess the panel height (3GU + 2DP) int QMirClientWindowPrivate::panelHeight() { + if (qEnvironmentVariableIsSet("QT_MIRCLIENT_IGNORE_PANEL")) + return 0; const int defaultGridUnit = 8; int gridUnit = defaultGridUnit; QByteArray gridUnitString = qgetenv("GRID_UNIT_PX"); -- cgit v1.2.3