Commit 1b989a04 authored by Martin Flöser's avatar Martin Flöser
Browse files

[server] Send pointer leave if focused surface gets unbound

Summary: As 9266a944 just for pointer.

Reviewers: #plasma, #frameworks

Subscribers: plasma-devel

Tags: #plasma_on_wayland, #frameworks

Differential Revision: https://phabricator.kde.org/D6754
parent 3db6bd64
......@@ -591,10 +591,11 @@ void TestWaylandSeat::testPointer()
QSignalSpy entered2Spy(p, &Pointer::entered);
QVERIFY(entered2Spy.wait());
QCOMPARE(p->enteredSurface(), s);
QSignalSpy leftSpy2(p, &Pointer::left);
QVERIFY(leftSpy2.isValid());
delete s;
QVERIFY(!p->enteredSurface());
wl_display_flush(m_connection->display());
QVERIFY(focusedPointerChangedSpy.wait());
QVERIFY(leftSpy2.wait());
QCOMPARE(focusedPointerChangedSpy.count(), 10);
QVERIFY(!m_seatInterface->focusedPointerSurface());
QVERIFY(!m_seatInterface->focusedPointer());
......
......@@ -265,9 +265,10 @@ void PointerInterface::setFocusedSurface(SurfaceInterface *surface, quint32 seri
return;
}
d->focusedSurface = surface;
d->destroyConnection = connect(d->focusedSurface, &QObject::destroyed, this,
d->destroyConnection = connect(d->focusedSurface, &Resource::aboutToBeUnbound, this,
[this] {
Q_D();
d->sendLeave(d->focusedChildSurface.data(), d->global->display()->nextSerial());
d->focusedSurface = nullptr;
d->focusedChildSurface.clear();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment