summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2018-02-28 14:12:34 +0100
committerJohan Helsing <johan.helsing@qt.io>2018-03-23 08:36:54 +0000
commit6bd1d22475a10e84f2bcc1eaa25bd7fb259e761b (patch)
tree0aef788bbb6c4d3b222afb5a5b2176982e3e1613 /tests
parentd29cbc2a0604f1b9a35f480a63a2472ca9e54661 (diff)
Fix crash when calling setVisible for EGL windows twice within one slot
Task-number: QTBUG-63411 Change-Id: I56c367a1801d215e93bf195332272cfee300cdd8 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/client/client/tst_client.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/tests/auto/client/client/tst_client.cpp b/tests/auto/client/client/tst_client.cpp
index 1e3d0f1d1..05b8bac1a 100644
--- a/tests/auto/client/client/tst_client.cpp
+++ b/tests/auto/client/client/tst_client.cpp
@@ -113,7 +113,10 @@ class TestGlWindow : public QOpenGLWindow
public:
TestGlWindow();
- uint paintGLCalled = 0;
+ int paintGLCalled = 0;
+
+public slots:
+ void hideShow();
protected:
void paintGL() override;
@@ -122,6 +125,12 @@ protected:
TestGlWindow::TestGlWindow()
{}
+void TestGlWindow::hideShow()
+{
+ setVisible(false);
+ setVisible(true);
+}
+
void TestGlWindow::paintGL()
{
glClear(GL_COLOR_BUFFER_BIT);
@@ -564,7 +573,15 @@ void tst_WaylandClient::glWindow()
QTRY_VERIFY(surface = compositor->surface());
compositor->sendShellSurfaceConfigure(surface);
- QTRY_VERIFY(testWindow->paintGLCalled);
+ QTRY_COMPARE(testWindow->paintGLCalled, 1);
+
+ //QTBUG-63411
+ QMetaObject::invokeMethod(testWindow.data(), "hideShow", Qt::QueuedConnection);
+ testWindow->requestUpdate();
+ QTRY_COMPARE(testWindow->paintGLCalled, 2);
+
+ testWindow->requestUpdate();
+ QTRY_COMPARE(testWindow->paintGLCalled, 3);
//confirm we don't crash when we delete an already hidden GL window
//QTBUG-65553