diff options
author | Paul Olav Tvete <paul.tvete@qt.io> | 2017-10-25 14:06:54 +0200 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@qt.io> | 2017-10-25 14:06:54 +0200 |
commit | 523cf490b4c46916c6f5253c666a492f5cce2aad (patch) | |
tree | b4514f338b143ab430fe2b91ec7699cb176a147e /tests/auto/client/client/tst_client.cpp | |
parent | 8e3c71b2d1ec37222bf1648aa23eb033062b4ea6 (diff) | |
parent | f1407493d6d25f24a3c71fbcedc00598baa44b56 (diff) |
Merge remote-tracking branch 'qt/5.9' into 5.10v5.10.0-beta3
Change-Id: I6c283081669594b3e8c6b30194bb96e389319cb2
Diffstat (limited to 'tests/auto/client/client/tst_client.cpp')
-rw-r--r-- | tests/auto/client/client/tst_client.cpp | 44 |
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 8acddfbe7..1eee90f49 100644 --- a/tests/auto/client/client/tst_client.cpp +++ b/tests/auto/client/client/tst_client.cpp @@ -143,6 +143,8 @@ private slots: void touchDrag(); void mouseDrag(); void dontCrashOnMultipleCommits(); + void hiddenTransientParent(); + void hiddenPopupParent(); private: MockCompositor *compositor; @@ -360,6 +362,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); |