diff --git a/autotests/client/test_text_input.cpp b/autotests/client/test_text_input.cpp --- a/autotests/client/test_text_input.cpp +++ b/autotests/client/test_text_input.cpp @@ -321,6 +321,8 @@ QSignalSpy unboundSpy(serverSurface, &QObject::destroyed); surface.reset(); QVERIFY(unboundSpy.wait()); + QVERIFY(leftSpy.wait()); + QVERIFY(!textInput->enteredSurface()); } void TextInputTest::testShowHidePanel_data() diff --git a/src/server/seat_interface.cpp b/src/server/seat_interface.cpp --- a/src/server/seat_interface.cpp +++ b/src/server/seat_interface.cpp @@ -1437,7 +1437,7 @@ } 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); }