summaryrefslogtreecommitdiffstats
path: root/tests/auto/client/client/tst_client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/client/client/tst_client.cpp')
-rw-r--r--tests/auto/client/client/tst_client.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/client/client/tst_client.cpp b/tests/auto/client/client/tst_client.cpp
index 981b8f129..e244de7f2 100644
--- a/tests/auto/client/client/tst_client.cpp
+++ b/tests/auto/client/client/tst_client.cpp
@@ -164,6 +164,7 @@ public slots:
private slots:
void primaryScreen();
void screens();
+ void addScreenWithGeometryChange();
void windowScreens();
void removePrimaryScreen();
void createDestroyWindow();
@@ -197,6 +198,29 @@ void tst_WaylandClient::screens()
QTRY_COMPARE(QGuiApplication::screens().size(), 1);
}
+//QTBUG-62044
+void tst_WaylandClient::addScreenWithGeometryChange()
+{
+ QTRY_COMPARE(QGuiApplication::screens().size(), 1);
+ const QRect oldGeometry = QGuiApplication::primaryScreen()->geometry();
+ compositor->sendAddOutput();
+
+ // Move the primary screen to the right
+ const QRect newGeometry(QPoint(screenSize.width(), 0), screenSize);
+ Q_ASSERT(oldGeometry != newGeometry);
+ compositor->sendOutputGeometry(compositor->output(0), newGeometry);
+
+ QTRY_COMPARE(QGuiApplication::screens().size(), 2);
+ QTRY_COMPARE(QGuiApplication::primaryScreen()->geometry(), newGeometry);
+
+ compositor->sendRemoveOutput(compositor->output(1));
+ QTRY_COMPARE(QGuiApplication::screens().size(), 1);
+
+ // Move the screen back
+ compositor->sendOutputGeometry(compositor->output(0), oldGeometry);
+ QTRY_COMPARE(QGuiApplication::primaryScreen()->geometry(), oldGeometry);
+}
+
void tst_WaylandClient::windowScreens()
{
QSharedPointer<MockOutput> firstOutput;
@@ -255,6 +279,7 @@ void tst_WaylandClient::removePrimaryScreen()
compositor->sendAddOutput();
QTRY_COMPARE(QGuiApplication::screens().size(), 2);
+ QTRY_COMPARE(QGuiApplication::primaryScreen()->virtualSiblings().size(), 2);
QScreen *secondaryScreen = QGuiApplication::screens().at(1);
QVERIFY(secondaryScreen);