From ec8887ad27cda04a030070e48a3081da78ecf4bf Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Fri, 18 Aug 2017 15:14:36 +0100 Subject: [PATCH] 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 --- src/wayland/autotests/client/test_wayland_surface.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/wayland/autotests/client/test_wayland_surface.cpp b/src/wayland/autotests/client/test_wayland_surface.cpp index a9064335b6..2b79dac7f6 100644 --- a/src/wayland/autotests/client/test_wayland_surface.cpp +++ b/src/wayland/autotests/client/test_wayland_surface.cpp @@ -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)