Commit 58eff400 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Prevent sending enter events to already focused surfaces

If the surface already has keyboard focus, do nothing.
parent 2209f94b
Pipeline #51339 passed with stage
in 6 minutes and 57 seconds
......@@ -1500,10 +1500,6 @@ void TestWaylandSeat::testKeyboard()
SurfaceInterface *serverSurface = surfaceCreatedSpy.first().first().value<KWaylandServer::SurfaceInterface*>();
QVERIFY(serverSurface);
m_seatInterface->setFocusedKeyboardSurface(serverSurface);
// no keyboard yet
QCOMPARE(m_seatInterface->focusedKeyboardSurface(), serverSurface);
QSignalSpy keyboardCreatedSpy(m_seatInterface, &SeatInterface::keyboardCreated);
QVERIFY(keyboardSpy.isValid());
......
......@@ -165,6 +165,10 @@ void KeyboardInterfacePrivate::sendModifiers()
void KeyboardInterface::setFocusedSurface(SurfaceInterface *surface, quint32 serial)
{
if (d->focusedSurface == surface) {
return;
}
d->sendLeave(d->focusedChildSurface, serial);
disconnect(d->destroyConnection);
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