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>
This commit is contained in:
parent
2804d35cb4
commit
91e81af14c
@ -113,7 +113,10 @@ class TestGlWindow : public QOpenGLWindow
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
TestGlWindow();
|
TestGlWindow();
|
||||||
uint paintGLCalled = 0;
|
int paintGLCalled = 0;
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void hideShow();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void paintGL() override;
|
void paintGL() override;
|
||||||
@ -122,6 +125,12 @@ protected:
|
|||||||
TestGlWindow::TestGlWindow()
|
TestGlWindow::TestGlWindow()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
void TestGlWindow::hideShow()
|
||||||
|
{
|
||||||
|
setVisible(false);
|
||||||
|
setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
void TestGlWindow::paintGL()
|
void TestGlWindow::paintGL()
|
||||||
{
|
{
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
@ -564,7 +573,15 @@ void tst_WaylandClient::glWindow()
|
|||||||
QTRY_VERIFY(surface = compositor->surface());
|
QTRY_VERIFY(surface = compositor->surface());
|
||||||
compositor->sendShellSurfaceConfigure(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
|
//confirm we don't crash when we delete an already hidden GL window
|
||||||
//QTBUG-65553
|
//QTBUG-65553
|
||||||
|
Loading…
x
Reference in New Issue
Block a user