diff --git a/src/wayland/autotests/client/test_text_input.cpp b/src/wayland/autotests/client/test_text_input.cpp index 9b11aeb392..baf56435d2 100644 --- a/src/wayland/autotests/client/test_text_input.cpp +++ b/src/wayland/autotests/client/test_text_input.cpp @@ -321,6 +321,8 @@ void TextInputTest::testEnterLeave() QSignalSpy unboundSpy(serverSurface, &QObject::destroyed); surface.reset(); QVERIFY(unboundSpy.wait()); + QVERIFY(leftSpy.wait()); + QVERIFY(!textInput->enteredSurface()); } void TextInputTest::testShowHidePanel_data() diff --git a/src/wayland/seat_interface.cpp b/src/wayland/seat_interface.cpp index 3b179821d5..7a295f7afa 100644 --- a/src/wayland/seat_interface.cpp +++ b/src/wayland/seat_interface.cpp @@ -1437,7 +1437,7 @@ void SeatInterface::setFocusedTextInputSurface(SurfaceInterface *surface) } d->textInput.focus.textInput = t; if (d->textInput.focus.surface) { - d->textInput.focus.destroyConnection = connect(surface, &QObject::destroyed, this, + d->textInput.focus.destroyConnection = connect(surface, &Resource::aboutToBeUnbound, this, [this] { setFocusedTextInputSurface(nullptr); }