MCPcopy Create free account
hub / github.com/KDE/kwin / testDisableShowInputPanel

Method testDisableShowInputPanel

autotests/integration/inputmethod_test.cpp:611–644  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

609}
610
611void InputMethodTest::testDisableShowInputPanel()
612{
613 // Create an xdg_toplevel surface and wait for the compositor to catch up.
614 std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
615 std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
616 Window *window = Test::renderAndWaitForShown(surface.get(), QSize(1280, 1024), Qt::red);
617 QVERIFY(window);
618 QVERIFY(window->isActive());
619 QCOMPARE(window->frameGeometry().size(), QSize(1280, 1024));
620
621 std::unique_ptr<KWayland::Client::TextInput> textInputV2(Test::waylandTextInputManager()->createTextInput(Test::waylandSeat()));
622
623 QSignalSpy inputMethodActiveSpy(kwinApp()->inputMethod(), &InputMethod::activeChanged);
624 // just enabling the text-input should not show it but rather on commit
625 QVERIFY(!kwinApp()->inputMethod()->isActive());
626 textInputV2->enable(surface.get());
627 QVERIFY(inputMethodActiveSpy.count() || inputMethodActiveSpy.wait());
628 QVERIFY(kwinApp()->inputMethod()->isActive());
629
630 // disable text input and ensure that it is not hiding input panel without commit
631 inputMethodActiveSpy.clear();
632 QVERIFY(kwinApp()->inputMethod()->isActive());
633 textInputV2->disable(surface.get());
634 QVERIFY(inputMethodActiveSpy.count() || inputMethodActiveSpy.wait());
635 QVERIFY(!kwinApp()->inputMethod()->isActive());
636
637 QSignalSpy requestShowInputPanelSpy(waylandServer()->seat()->textInputV2(), &TextInputV2Interface::requestShowInputPanel);
638 textInputV2->showInputPanel();
639 QVERIFY(requestShowInputPanelSpy.count() || requestShowInputPanelSpy.wait());
640 QVERIFY(!kwinApp()->inputMethod()->isActive());
641
642 shellSurface.reset();
643 QVERIFY(Test::waitForWindowClosed(window));
644}
645
646void InputMethodTest::testModifierForwarding()
647{

Callers

nothing calls this directly

Calls 15

createSurfaceFunction · 0.85
createXdgToplevelSurfaceFunction · 0.85
waylandTextInputManagerFunction · 0.85
waylandSeatFunction · 0.85
kwinAppFunction · 0.85
waylandServerFunction · 0.85
waitForWindowClosedFunction · 0.85
frameGeometryMethod · 0.80
createTextInputMethod · 0.80
inputMethodMethod · 0.80
textInputV2Method · 0.80
showInputPanelMethod · 0.80

Tested by

no test coverage detected