[client] Use a QPointer for the enteredSurface in Pointer

If the client deletes the currently entered Surface the Pointer should
return null in Pointer::enteredSurface and not invalid memory.

At the same time a now incorrect assert is removed. After the client
deletes the Surface it might still get a left event for the Surface.
In that case a comparison between the enteredSurface and the Surface
from the leave event would fail.

Reviewed-By: bshah
This commit is contained in:
Martin Gräßlin 2016-08-04 10:02:38 +02:00
parent 2c79c7ff5f
commit a612cfa499

View file

@ -511,7 +511,11 @@ void TestWaylandSeat::testPointer()
serverPointer = m_seatInterface->focusedPointer();
QVERIFY(serverPointer);
QSignalSpy entered2Spy(p, &Pointer::entered);
QVERIFY(entered2Spy.wait());
QCOMPARE(p->enteredSurface(), s);
delete s;
QVERIFY(!p->enteredSurface());
wl_display_flush(m_connection->display());
QVERIFY(focusedPointerChangedSpy.wait());
QCOMPARE(focusedPointerChangedSpy.count(), 10);