From dd873cb980babd916321f259124f7caacff52690 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Fl=C3=B6ser?= Date: Wed, 19 Jul 2017 20:16:57 +0200 Subject: [PATCH] [server] Send text input leave if focused surface gets unbound Summary: As 9266a944007e1bc91282961f271a5f9d18043d1f just for text input. Test Plan: Adjusted test passes, fails without adjustment Reviewers: #plasma, #frameworks Subscribers: plasma-devel Tags: #plasma_on_wayland, #frameworks Differential Revision: https://phabricator.kde.org/D6786 --- src/wayland/autotests/client/test_text_input.cpp | 2 ++ src/wayland/seat_interface.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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); }