diff --git a/src/inputmethod.cpp b/src/inputmethod.cpp index e625f8da67..81b55a6635 100644 --- a/src/inputmethod.cpp +++ b/src/inputmethod.cpp @@ -514,6 +514,7 @@ void InputMethod::adoptInputMethodContext() connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::preeditString, this, &InputMethod::setPreeditString, Qt::UniqueConnection); connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::preeditCursor, this, &InputMethod::setPreeditCursor, Qt::UniqueConnection); connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::keyboardGrabRequested, this, &InputMethod::installKeyboardGrab, Qt::UniqueConnection); + connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::modifiersMap, this, &InputMethod::updateModifiersMap, Qt::UniqueConnection); } void InputMethod::updateInputPanelState() @@ -660,6 +661,15 @@ void InputMethod::installKeyboardGrab(KWaylandServer::InputMethodGrabV1 *keyboar }); } +void InputMethod::updateModifiersMap(const QByteArray &modifiers) +{ + TextInputV2Interface *t2 = waylandServer()->seat()->textInputV2(); + + if (t2 && t2->isEnabled()) { + t2->setModifiersMap(modifiers); + } +} + bool InputMethod::isVisible() const { return m_inputClient && m_inputClient->isShown(false); diff --git a/src/inputmethod.h b/src/inputmethod.h index b14999ea96..6f06c663fe 100644 --- a/src/inputmethod.h +++ b/src/inputmethod.h @@ -92,6 +92,7 @@ private: void stopInputMethod(); void setTrackedClient(AbstractClient *trackedClient); void installKeyboardGrab(KWaylandServer::InputMethodGrabV1 *keyboardGrab); + void updateModifiersMap(const QByteArray &modifiers); bool touchEventTriggered() const;