KWayland::Client::Surface track output destruction

Summary:
A compositor should send left events before deleting an output; however
if it doesn't, we don't want dangly pointers in our list of outputs on
the client surface.

Test Plan: Unit test

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: plasma-devel, #frameworks

Tags: #plasma_on_wayland, #frameworks

Differential Revision: https://phabricator.kde.org/D7379
This commit is contained in:
David Edmundson 2017-08-18 15:14:36 +01:00
parent eac4973697
commit ec8887ad27

View file

@ -1076,6 +1076,12 @@ void TestWaylandSurface::testOutput()
QVERIFY(enteredSpy.wait());
QCOMPARE(enteredSpy.count(), 2);
QCOMPARE(leftSpy.count(), 1);
//test the client handles a misbehaving server that removes a display before updating clients
m_display->removeOutput(serverOutput);
QCOMPARE(leftSpy.count(), 1);
QVERIFY(s->outputs().isEmpty());
}
QTEST_GUILESS_MAIN(TestWaylandSurface)