diff --git a/autotests/integration/inputmethod_test.cpp b/autotests/integration/inputmethod_test.cpp index df34eb2106..dabeef263b 100644 --- a/autotests/integration/inputmethod_test.cpp +++ b/autotests/integration/inputmethod_test.cpp @@ -137,6 +137,8 @@ void InputMethodTest::testOpenClose() // Show the keyboard touchNow(); + QSignalSpy paneladded(kwinApp()->inputMethod(), &KWin::InputMethod::panelChanged); + QVERIFY(paneladded.wait()); textInput->showInputPanel(); QVERIFY(windowAddedSpy.wait()); @@ -212,6 +214,8 @@ void InputMethodTest::testEnableActive() QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded); std::unique_ptr textInput(Test::waylandTextInputManager()->createTextInput(Test::waylandSeat())); textInput->enable(surface.get()); + QSignalSpy paneladded(kwinApp()->inputMethod(), &KWin::InputMethod::panelChanged); + QVERIFY(paneladded.wait()); textInput->showInputPanel(); QVERIFY(windowAddedSpy.wait()); QVERIFY(kwinApp()->inputMethod()->isActive()); @@ -247,6 +251,8 @@ void InputMethodTest::testHidePanel() waylandServer()->seat()->setFocusedTextInputSurface(window->surface()); textInput->enable(surface.get()); + QSignalSpy paneladded(kwinApp()->inputMethod(), &KWin::InputMethod::panelChanged); + QVERIFY(paneladded.wait()); textInput->showInputPanel(); QVERIFY(windowAddedSpy.wait()); @@ -256,7 +262,7 @@ void InputMethodTest::testHidePanel() QVERIFY(activateSpy.count() || activateSpy.wait()); QVERIFY(kwinApp()->inputMethod()->isActive()); - auto keyboardWindow = Test::inputPanelWindow(); + auto keyboardWindow = kwinApp()->inputMethod()->panel(); auto ipsurface = Test::inputPanelSurface(); QVERIFY(keyboardWindow); windowRemovedSpy.clear(); diff --git a/autotests/integration/kwin_wayland_test.h b/autotests/integration/kwin_wayland_test.h index bb63f5641f..8486748421 100644 --- a/autotests/integration/kwin_wayland_test.h +++ b/autotests/integration/kwin_wayland_test.h @@ -438,10 +438,6 @@ public: MockInputMethod(struct wl_registry *registry, int id, int version); ~MockInputMethod(); - Window *window() const - { - return m_window; - } KWayland::Client::Surface *inputPanelSurface() const { return m_inputSurface.get(); @@ -461,7 +457,6 @@ protected: private: std::unique_ptr m_inputSurface; QtWayland::zwp_input_panel_surface_v1 *m_inputMethodSurface = nullptr; - QPointer m_window; struct ::zwp_input_method_context_v1 *m_context = nullptr; }; @@ -654,7 +649,6 @@ bool lockScreen(); */ bool unlockScreen(); -Window *inputPanelWindow(); MockInputMethod *inputMethod(); KWayland::Client::Surface *inputPanelSurface(); diff --git a/autotests/integration/test_helpers.cpp b/autotests/integration/test_helpers.cpp index 4c4c87b117..d78140d844 100644 --- a/autotests/integration/test_helpers.cpp +++ b/autotests/integration/test_helpers.cpp @@ -255,11 +255,6 @@ static struct TextInputManagerV3 *textInputManagerV3 = nullptr; } s_waylandConnection; -Window *inputPanelWindow() -{ - return s_waylandConnection.inputMethodV1->window(); -} - MockInputMethod *inputMethod() { return s_waylandConnection.inputMethodV1; @@ -286,7 +281,7 @@ void MockInputMethod::zwp_input_method_v1_activate(struct ::zwp_input_method_con m_inputMethodSurface = Test::createInputPanelSurfaceV1(m_inputSurface.get(), s_waylandConnection.outputs.first()); } m_context = context; - m_window = Test::renderAndWaitForShown(m_inputSurface.get(), QSize(1280, 400), Qt::blue); + Test::render(m_inputSurface.get(), QSize(1280, 400), Qt::blue); Q_EMIT activate(); }