summaryrefslogtreecommitdiffstats
path: root/tests/auto/client
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@qt.io>2017-10-27 10:37:21 +0200
committerPaul Olav Tvete <paul.tvete@qt.io>2017-10-27 10:37:21 +0200
commit62293cefae129bbfebb0317b39d059b0abb1a16a (patch)
tree159080c98a85baa02e34776cf2618642ae55d456 /tests/auto/client
parentc2b272ac73617a8d5ff25151534feda95ace63ee (diff)
parent523cf490b4c46916c6f5253c666a492f5cce2aad (diff)
Merge remote-tracking branch 'qt/5.10' into dev
Diffstat (limited to 'tests/auto/client')
-rw-r--r--tests/auto/client/client/tst_client.cpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/auto/client/client/tst_client.cpp b/tests/auto/client/client/tst_client.cpp
index 0a3c7bef7..f337e6b4a 100644
--- a/tests/auto/client/client/tst_client.cpp
+++ b/tests/auto/client/client/tst_client.cpp
@@ -144,6 +144,8 @@ private slots:
void touchDrag();
void mouseDrag();
void dontCrashOnMultipleCommits();
+ void hiddenTransientParent();
+ void hiddenPopupParent();
private:
MockCompositor *compositor;
@@ -362,6 +364,48 @@ void tst_WaylandClient::dontCrashOnMultipleCommits()
QTRY_VERIFY(!compositor->surface());
}
+void tst_WaylandClient::hiddenTransientParent()
+{
+ QWindow parent;
+ QWindow transient;
+
+ transient.setTransientParent(&parent);
+
+ parent.show();
+ QTRY_VERIFY(compositor->surface());
+
+ parent.hide();
+ QTRY_VERIFY(!compositor->surface());
+
+ transient.show();
+ QTRY_VERIFY(compositor->surface());
+}
+
+void tst_WaylandClient::hiddenPopupParent()
+{
+ TestWindow toplevel;
+ toplevel.show();
+
+ // wl_shell relies on a mouse event in order to send a serial and seat
+ // with the set_popup request.
+ QSharedPointer<MockSurface> surface;
+ QTRY_VERIFY(surface = compositor->surface());
+ QPoint mousePressPos(16, 16);
+ QCOMPARE(toplevel.mousePressEventCount, 0);
+ compositor->sendMousePress(surface, mousePressPos);
+ QTRY_COMPARE(toplevel.mousePressEventCount, 1);
+
+ QWindow popup;
+ popup.setTransientParent(&toplevel);
+ popup.setFlag(Qt::Popup, true);
+
+ toplevel.hide();
+ QTRY_VERIFY(!compositor->surface());
+
+ popup.show();
+ QTRY_VERIFY(compositor->surface());
+}
+
int main(int argc, char **argv)
{
setenv("XDG_RUNTIME_DIR", ".", 1);