[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:
parent
2c79c7ff5f
commit
a612cfa499
1 changed files with 4 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue